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

Issue 49 - Ability to skip files matching RegEx #18

Closed adamrodger closed 13 years ago

adamrodger commented 13 years ago

Hi dbr,

I've had a look at the issues list for tvnamer and saw issue 49 about skipping files that match a (set of) regexs in config.

I've implemented some changes for you to review to resolve this issue. I've written unit tests and updated docstrings as appropriate.

Regards, Adam

dbr commented 13 years ago

I wonder if it would make sense to specify the blacklist in a similar format to the replacements?

https://github.com/dbr/tvnamer/blob/master/tvnamer/utils.py#L43-63

..without the "replacement" key. Would make it more consistent, and would allow you to do simple string matching, or regex (and eventually specifying regex flags, something I want to add for the replacements)

Other than that, looks good to me! More so because it has test-cases \o/

adamrodger commented 13 years ago

Yeah makes sense. Again, for consistency's sake, is it worth doing the same thing to the "valid extensions" function or is that a bit too complex for that pretty simple feature?

dbr commented 13 years ago

Perfect, thanks!

I think makes sense to keep the extensions as is - a simple list should over a majority of cases, and if it's not enough, your new blacklist option can used - e.g could configure it to skip .*\.mpe?g$