dbr / tvnamer

Automatic TV episode file renamer, uses data from thetvdb.com via tvdb_api
https://pypi.python.org/pypi/tvnamer/
The Unlicense
911 stars 115 forks source link

Filter results to a series_id_list #199

Open nephlm opened 3 years ago

nephlm commented 3 years ago

Story: a directory full of files from a known set of serieses, but more than one, and let's say that file globbing is inconvenient for the situation I'm working with. I'd like to be able to specify a collection of series_ids and have tvnamer filter out any results that don't match one of those ids. In most cases this will be used with "select_first" or the default behavior of when a single result is returned.

I have code to do this, and was wondering if it was of any interest upstream to make it worth cleaning up and disentangling it from other changes? It may be too niche of a desire to be worth maintaining upstream, but it would make my life slightly easier if I didn't have to update it when new versions come out, so I figured I'd see if there was any interest.

New config settings:

Passes a custom_ui to tvdb_api to filter the list before the normal uis present them to the user. Reproduced the interactive logic from tvdb_api so "select_first" still works.

In retrospect, the file stuff might not have a place in tvnamer, I can rip that out and do something external to populate the series_id_list if that's preferred, after all it's a json file. The more significant issue is that series_id and series_id_list do similar, but not quite the same things and are named way too similarly. I suspect a new name is in order, though I don't know what it would be at present.

These are the bulk of the changes in questions as they currently exist: https://github.com/nephlm/tvnamer/commit/241fe6c07415089427fe6c66fc8ceacae4069858