dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
912 stars 115 forks source link

[PATCH] Option --series-id does not work #74

Closed scott323 closed 11 years ago

scott323 commented 11 years ago

Hello, I want to report a problem with the '--series-id' option, and also offer a solution which works for me.

Test case:

tvnamer --series-id=80379 6x17.HDTV.x264-LOL.mp4

Output:

####################
# Starting tvnamer
Parsed filename did not contain series name (and --name not specified), skipping: /home/scott/Downloads/tv_shows/The Big Bang Theory [80379]/6x17.HDTV.x264-LOL.mp4
Usage: tvnamer [options] <files>

tvnamer: error: No valid files were supplied

Patch solving the problem:

--- main.py.old 2013-03-12 14:33:08.558919405 +0100
+++ main.py     2013-03-12 14:36:24.594642239 +0100
@@ -302,8 +302,8 @@
         except InvalidFilename, e:
             warn("Invalid filename: %s" % e)
         else:
-            if episode.seriesname is None and Config['force_name'] is None:
-                warn("Parsed filename did not contain series name (and --name not specified), skipping: %s" % cfile)
+            if episode.seriesname is None and Config['force_name'] is None and Config['series_id'] is None:
+                warn("Parsed filename did not contain series name (and --name or --series-id not specified), skipping: %s" % cfile)
             else:
                 episodes_found.append(episode)
dbr commented 11 years ago

Change applied - thank you!