Acizza/anup

Episode mathcing regex pattern unclear

Artish357 opened this issue · 2 comments

First thing I want to mention: this project is awesome!
But the documentation is a bit lacking outside of source code, so I ran into a wall while trying to organize my collection
I have a folder Nichijou, where files are labeled like Nichijou XX.mpv
:add Nichijou fails, because it can't parse episode names
If i rename them to Nichijou - XX.mpv, it works
How do I write a regex to parse this? I tried a couple things, and they didn't work.
Also, any chance of adding that regex as one of the default?

Thanks for your efforts!

Hi!

I apologize for the lack of documentation. I plan on addressing it at some point once I have some more free time.

As for your issue, you should be able to use the following command to add Nichijou:
:add Nichijou matcher=".+{episode}"

The {episode} fragment is basically a wrapper around the regex pattern \d+. So, for example, the episode matcher pattern .+? - EP{episode} will be expanded internally to .+? - EP(\d+).

The default regex pattern to detect episodes tries to match as many formats as possible, but it is large enough now that changing it even a little bit tends to break one format or another (if you're curious, it is located here). I have plans to write an episode parser in pure Rust code, which should make it much easier to add new types of formats.

EDIT: I have updated the README to better explain how adding a series works. It also fully documents the add command and its various options.

Thanks, it worked!
README is also really helpful 👍