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

Implemented matching against filename and path #108

Open m42e opened 9 years ago

m42e commented 9 years ago

See http://dbr.lighthouseapp.com/projects/36049/tickets/9-episode-patterns-that-match-against-path

dbr commented 9 years ago

Cool, thanks!

A few small things:

  1. A comment on filenames = [filename, fullname] etc would be good, as it was momentarily confusing why the code was like that (also, pedantically, the variables are a bit similar - filename, fullname, filenames, then filename is reused for the loop)
  2. Should it match against the filename before the full path? I would have thought the regexs for the full path should run first, since they are very unlikely to falsely match
  3. Could you add a couple of test cases (pretty much like the test_functional.py) - I guess the cases which should be tested are:
    • tvnamer /path/to/my show/season 1/03 - example.avi
    • tvnamer ./03 - example.avi (i.e does it run abspath on the path before parsing?)

Thoughts? I'm happy to make the changes if you don't have time

m42e commented 9 years ago

Hi,

I'm currently into it. Give me a few more days and I clean it up.