dbr / tvnamer

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

move_files_destination crash when missing season number. #127

Open f4hy opened 8 years ago

f4hy commented 8 years ago

If including a season number in the file destination path such as from my config:

"move_files_destination": "/mnt/bigmedia/tv/%(seriesname)s/season%(seasonnumber)d/",

if running on a series which does not have a seasons number this fails with the message:

Traceback (most recent call last): File "/usr/bin/tvnamer", line 9, in <module> load_entry_point('tvnamer==2.3', 'console_scripts', 'tvnamer')() File "/usr/lib/python2.7/site-packages/tvnamer/main.py", line 418, in main tvnamer(paths = sorted(args)) File "/usr/lib/python2.7/site-packages/tvnamer/main.py", line 325, in tvnamer processFile(tvdb_instance, episode) File "/usr/lib/python2.7/site-packages/tvnamer/main.py", line 244, in processFile newPath = getMoveDestination(episode) File "/usr/lib/python2.7/site-packages/tvnamer/main.py", line 75, in getMoveDestination 'originalfilename': episode.originalfilename, KeyError: u'seasonnumber'