Open ardumont opened 5 years ago
I found this rather limited but it works.
I don't really know how to apply this generically though (maybe some users would want that on other keys and with more than 1 first letter).
In the mean time, here is my actual proposal [1]
I have been using this successfully for a while now [2]
[1] https://github.com/ardumont/tvnamer/commit/d3012571b97aef2ae583eec9ce14e7ecb6b82acb
[2] https://gitlab.com/ardumont/nixos/-/blob/master/rpi4/pytools/default.nix#L31
Cheers,
Hello,
First, thanks for tvnamer, quite a time saver!
Regarding moving file configuration, this would be great to allow more flexibility in the path setup (
move_files_destination
option).For example, today we can define:
I'd like to be able to set a more specific path still based on those options, for example, splitting on the first letter of the tvshow:
As far as i could see in the code, that part is static so we cannot yet (checked doc, code and issues). The formatting uses a dict with special keywords [1].
[1] https://github.com/dbr/tvnamer/blob/d4f52624353a9050708ae2b7c3cbd3cb16bb570d/tvnamer/main.py#L63-L74
To test the idea, i patched locally my installation to adapt that dict accordingly (for all conditionals), for example:
I found this rather limited but it works.
I don't really know how to apply this generically though (maybe some users would want that on other keys and with more than 1 first letter).
config:
Relatedly, other tools like flexget [2] uses jinja [3]. That allows configuration to look like:
(this is verbose but it's declarative enough ;)
Then again that adds a new dependency and possibly new issues for you later down the line.
[2] https://github.com/Flexget/Flexget
[3] http://jinja.pocoo.org/
Cheers,