Page 1 of 1

Source Media {vs} and {source}

Posted: 21 Nov 2019, 15:06
by rednoah
The source media (e.g. BluRay, WEB-DL, etc) can only be detected based on the file name.

  • {vs} ... the standardized source media value regardless of which exact pattern was a match (e.g. any match for BluRay / BDRip / BD50 / etc yields BluRay)
  • {source} ... the exact pattern match based on the file name (e.g. match for BD50 yields BD50)


FileBot uses the following patterns:
https://github.com/filebot/data/blob/master/media-sources.txt


:idea: FileBot will check not only {fn} (file name) but also {original} (original file name recorded via xattr) as well as {mediaTitle} (embedded media title) for source pattern matches. The order of precedence is mediaTitle, then original, then fn as last resort.


:idea: Changes in classification and additional patterns can be added upon request. Please post change requests (including example file paths) here.

Re: Source Media {vs} and {source}

Posted: 18 May 2020, 15:16
by devster
Is source now an exact match for case as well?
It seems that the following happens:

Code: Select all

fn: aaaaa.s01e01.hdtv.mkv => nice name - S01E01 - hdtv.mkv
fn: aaaaa.s01e01.HDTV.mkv => nice name - S01E01 - HDTV.mkv
As a corollary, how could I get the same behaviour as before (capital HDTV on non-capital match) or alternatively how could I choose {vs} over {source} only for specific values?

Re: Source Media {vs} and {source}

Posted: 18 May 2020, 16:27
by rednoah
You can do {vs.upper()} and {source.upper()} if you want an uppercase value.

Re: Source Media {vs} and {source}

Posted: 18 May 2020, 17:11
by devster
Not quite, I want BluRay and HDTV from {vs}, but I do my own matching for anything WEB.*
Hence the difference.
I'm currently doing:

Code: Select all

String src
if (['BluRay', 'HDTV'].contains(vs) {
  src = vs
} else {
  src = source
} 
just wondering if there's a better way.

Re: Source Media {vs} and {source}

Posted: 18 May 2020, 17:29
by rednoah
Well, I guess I'd write it like this:

Code: Select all

def src = vs =~ /BluRay|HDTV/ ? vs : source