Can I modify how the Movie Database Scraper add on resolves movie names
#10
Man, I feel so dumb some times.  Of course you could use cleandatetime to discard junk on the left of the title, as well as on the right.

What I realise/remember now is what you can't do is have the title on the right of a year you want to keep, e.g "[2003] 21 Grams.mp4".  That won't work.
That's because the title part always has to be in the first capturing group, and the year has to be in the second
Since the capturing groups have to run in order, the title has to be before the year... Although maybe you could do some weird positive lookahead trick to switch the order... Hmm...

Anyway, besides the point.  Basically, you need to wrap brackets around the things you want to keep, such that the part that's the title is in the first set, and the part that's the year is in second.
Whether you can pull that off for both types of filename simultaneously might be tricky .  But almost certainly not impossible.

(The cleanstring regexes, on the other hand, just have to match the thing to be removed, and then only the stuff before the first match is kept, so there's absolutely no way to use them to remove anything to the left of the title.)

Kodi passes the contents of the first capturing group from cleandatetime through cleanstring, and then whatever remains is percent-encoded and placed in buffer $$1 in the CreateSearchUrl function for the scraper being used.
The second capturing group, with the year in it, is placed in buffer $$2.

The cleandatetime regex that is currently being used is here in the source code (just replace all the double backslashes with single backslashes).
I haven't bothered to check if it's different from the one in the wiki or not, although it hasn't been changed in five years, so I'd hope they match.
Reply


Messages In This Thread
RE: Can I modify how the Movie Database Scraper add on resolves movie names - by scudlee - 2020-03-03, 23:17
Logout Mark Read Team Forum Stats Members Help
Can I modify how the Movie Database Scraper add on resolves movie names0