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

When querying the tvdb returns an error, exit with an appropriate error code #73

Closed mb5 closed 6 years ago

mb5 commented 11 years ago

Currently, tvnamer exits with 0 even though renaming failed if say tvdb should return a 4xx or 5xx HTTP error. Especially the later ones usually indicate server errors. This behavior makes it more difficult to use tvnamer in scripts if one needs to detect failures. tvnamer should therefore exit with an appropriate error code if renaming should fail because of any HTTP errors.

dbr commented 11 years ago

Hm, true. If it finds any valid file, the exit code will be zero.

Need to think about it further, specifically what should happen if some files are valid, but one errors (e.g what if one series cannot be found?). Any thoughts?

I guess ideally, tvnamer would be more atomic - all the files would be processed first, then the files would be renamed. That way, in batchmode it could error out cleanly

dbr commented 6 years ago

skip_behaviour config option now controls this