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

List Missing Episodes #19

Closed ghost closed 12 years ago

ghost commented 13 years ago

Just a small feature request, say you're sorting through a series would it be possible to list the files that can't be found or matched, hinting at episodes that might be missing? There'd probably need to be a date check between date aired, but I think it would be a nice little feature.

On an unrelated note, can you supply an example on the homepage for input_filename_replacements ? I tried adapting the output_filename_replacements section, but got an unusual output (also using old version). May just be because I don't know regex very well, but a little guide would be awesome.

dbr commented 13 years ago

The README is is need of a big update, as it doesn't mention a lot of features added recently (..and not so recently).

I also plan to create a bunch of example configs (some of which will use the replacements).. But, for now, the test cases have a few examples:

https://github.com/dbr/tvnamer/blob/master/tests/test_custom_replacement.py

{
    "move_files_enable": true,
    "move_files_destination": "%(seriesname)s",
    "move_files_fullpath_replacements": [
        {"is_regex": true,
        "match": "Scr.*?s",
        "replacement": "A Test"}
    ],
    "always_rename": true,
    "select_first": true
}

Oh, the Python shell might be of use to debug the regex pattern:

$ python
>>> import re
>>> re.sub("Bl.*?h", "", "Test Input Blah String")
'Test Input  String'

(technically you should do re.compile("Bl.*?", re.VERBOSE).sub("", "Test Input String") to exactly mimic what tvnamer does, but that should be irrelevant)

dbr commented 13 years ago

Heh, forgot to respond to the actual issue,

Just a small feature request, say you're sorting through a series would it be possible to list the files that can't be found or matched, hinting at episodes that might be missing?

tvnamer should already print files that can't be parsed. For missing files - I assume you mean if you have episodes 1-4, 6-12, it would print "missing episode 5?

I wrote a separate project to do this, https://github.com/dbr/checktveps - it checks against a fairly rigid set of patterns, and shows any missing episodes.

ghost commented 13 years ago

Wow. Concise, informative and speedy reply.

I must have made an error with my previous replacement code, I adapted one of your examples and it worked perfectly first time round. Couldn't be happier. Thanks for the tip with the python shell too, I've only touched on learning it so it should come in useful in future.

You were right with the assumption, didn't realise you'd coded something else to do the job. I can't check it at the moment but having a quick read it seems to more than do the job. Just wondering if it would make sense or be worth the effort to merge the projects as they have similar aims? A tvnamer testdir/ --missing option is how I'd envisage it, but obviously it's totally up to you.

Again, keep up the great work.

dbr commented 12 years ago

Just wondering if it would make sense or be worth the effort to merge the projects as they have similar aims?

I think they should remain separate projects - there's not a lot of overlapping functionality between the two.. At most they might share the regex's/filename-parser, but beyond that they are quite different!

Oh, SickBeard might be of interest (it does a good job of scanning a bunch of series and showing missed episodes)