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

KeyError: u'seasonnumber' #58

Open weedy opened 12 years ago

weedy commented 12 years ago
Existing filename is correct: [Taka] Naruto Shippuuden - 262 - War Begins [4B93BD6A].mp4
####################
Traceback (most recent call last):
  File "/usr/bin/tvnamer-2.7", line 9, in <module>
    load_entry_point('tvnamer==2.2.1', 'console_scripts', 'tvnamer')()
  File "/usr/lib64/python2.7/site-packages/tvnamer/main.py", line 416, in main
    tvnamer(paths = sorted(args))
  File "/usr/lib64/python2.7/site-packages/tvnamer/main.py", line 323, in tvnamer
    processFile(tvdb_instance, episode)
  File "/usr/lib64/python2.7/site-packages/tvnamer/main.py", line 243, in processFile
    newPath = getMoveDestination(episode)
  File "/usr/lib64/python2.7/site-packages/tvnamer/main.py", line 75, in getMoveDestination
    'originalfilename': episode.originalfilename,
KeyError: u'seasonnumber'
dbr commented 12 years ago

I think this is caused by this bug - certain episode types don't get all episode data - the Anime-episode-info class doesn't currently get season number

I'll try and fix this soon..

weedy commented 11 years ago

dot dot dot

averissimo commented 11 years ago

temporary (ugly) fix: https://github.com/averissimo/tvnamer/commit/6581d66cb0c3876aec8c0c768f0b2794b4569b21

basically it defaults the season number to 0 for these cases