Page 1 of 1

Keeping tags from release name

Posted: 28 Feb 2018, 12:58
by Zebbe152
I want to keep some of the tags from the release name, such as PROPER, REPACK, REAL etc.

I've been using {'.'+fn.match(/REAL/).upper()} in my script and it's been working great. However, yesterday I ran into a problem with the show UnREAL.

The original title: UnREAL.S03E01.720p.HDTV.x264-BATV

The result was: UnREAL.S03E01.REAL.720p

As you can see filebot added the REAL tag at the end because of the title of the show. It there any way to prevent this from happening? I really want to be able to keep the REAL tags in the filename if it's possible.

Re: Keeping tags from release name

Posted: 28 Feb 2018, 18:15
by rednoah
1.
You could match the . before and after. It won't work for all possible corner cases, but it's easy and it'll work for your specific example:

Code: Select all

fn.match(/[.]REAL[.]/)

2.
You could also match REAL only when it precedes 720p|1080p|etc but unfortunately there's no easy magic solution that works for all corner cases.


3.
In the case of episode files, only matching REAL after some 01 double digit patterns might be a surprisingly good solution:

Code: Select all

fn.after(/\d\d/).match(/REAL/)

Re: Keeping tags from release name

Posted: 28 Feb 2018, 18:33
by Zebbe152
Thank you!

Option 1 is probably the best solution in my case. I tried something similar yesterday but I got the formatting wrong... :)