Is there any way to deal with contradictive episode information in path?

All about user-defined episode / movie / file name format expressions
Post Reply
randomtask
Posts: 3
Joined: 19 Dec 2020, 10:06

Is there any way to deal with contradictive episode information in path?

Post by randomtask »

Hi,

thanks a lot for this nice tool!

I'm currently struggling with some poorly named downloads. The extracted structure is the following:
TV.Show.A.S01E01/TV.Show.A.S02E01/TV.Show.A.S02E01.mkv
In this case the root folder episode information is correct whereas the information of the children is incorrect.

Is there any nice way to deal with these kind of files?
I tried to preprocess them by renaming them to {f.dir.dir} but some folders directly contain the video file without the other folder in between which messed up the format output.
Could I for example specify a groovy format expression to rename the episode by explicitly using the first (or last) occurrence of SxxExx notation?

Thanks a lot for your help.
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: Is there any way to deal with contradictive episode information in path?

Post by kim »

try this

Code: Select all

{fn.replaceFirst(f.name.match(/S\d+E\d+|\d+x\d+/), f.path.match(/S\d+E\d+|\d+x\d+/))}
randomtask
Posts: 3
Joined: 19 Dec 2020, 10:06

Re: Is there any way to deal with contradictive episode information in path?

Post by randomtask »

Works like a charm. Thanks a lot for the quick help!
Post Reply