Plex Jellyfin Editions with Multi Tags / Matching

All about user-defined episode / movie format expressions
Post Reply
ByteShare
Posts: 29
Joined: 13 Mar 2018, 15:38

Plex Jellyfin Editions with Multi Tags / Matching

Post by ByteShare »

Hi, I've tried a bit and searched around but haven't figured out a way to correctly match parts of a string of tags at a time.
Please help :D

3 initial matches

Code: Select all

{fn.matchAll(/Unrated|\[UR\]/)?'UR':''}
{fn.matchAll(/DirectorsCut|Director.*Cut|Director'sCut|\[DC]/)?' DC':''}
{fn.matchAll(/ExtendedEdition|\[EE\]|\[Extended\]|Extended|\[Ext\]/)?' Ext':''}
Starting point for the Editions Tag (I use both Jellyfin and Plex so I combine the formats)

Code: Select all

{" - [{edition-${}]"}
This works but only if I match all 3 at the same time, so I know I'm doing something wrong but I don't know what would fix it.
I'm assuming it has something to do with the "$" :?:

Code: Select all

{" - [{edition-${fn.matchAll(/Unrated|\[UR\]/)?'UR':''}${fn.matchAll(/DirectorsCut|Director.*Cut|Director'sCut|\[DC]/)?' DC':''}${fn.matchAll(/ExtendedEdition|\[EE\]|\[Extended\]|Extended|\[Ext\]/)?' Ext':''}}]"}
Update: Just saw your link to viewtopic.php?t=12643 Not sure if this will solve my problem but I'll take a look at that.
User avatar
rednoah
The Source
Posts: 21332
Joined: 16 Nov 2011, 08:59

Re: Plex Jellyfin Editions with Multi Tags / Matching

Post by rednoah »

Does {tags} not work for you? Are you set on your UR / DC / Ext abbreviation and normalisation step?
viewtopic.php?t=12668


:idea: You'll want to keep in mind the that the outer-most {...} delimit Groovy code, and are thus completely different in meaning from inner {...} which are Groovy code:
viewtopic.php?t=1895


:?: Do Plex / Jellyfin / etc support multiple {edition-XYZ} tags?

Code: Select all

{edition-X} {edition-Y} {edition-Z}
:?: Do you want to generate a custom edition value that just combines multiple tags as single edition value?

Code: Select all

{edition-X and Y and Z}


:arrow: You probably mean to write something like this:

Code: Select all

{
	def value = tags.join(' ').replace('Uncut':'UC', 'Unrated':'UR')
	'{edition-' + value + '}'
}
:idea: Please read the FAQ and How to Request Help.
ByteShare
Posts: 29
Joined: 13 Mar 2018, 15:38

Re: Plex Jellyfin Editions with Multi Tags / Matching

Post by ByteShare »

--"Do Plex / Jellyfin / etc support multiple {edition-XYZ} tags?"
Both do support 1 edition in a file name, but what ever you want as long as it is between the [] and/or {}, like I have it will show that whole string as an "Edition"
So only " - [{edition-STUFF}]" one time in a filename
So not this:

Code: Select all

{edition-X} {edition-Y} {edition-Z}
--I'd have to think if I want to change my custom tags, because I usually got for shorter filenames (especially now with the long format for Editions). Also, I do need some custom tagging (not all shown here) for example Rifftrax and FanEdits.

--Basically, I want to combine my custom tags depending what is in the file name:
So "Movie (Year) [UR] Directors Cut Extended.mp4"
Would go to "Movie (Year) - [{edition-UR DC Ext}].mp4"
Or if just one of those (ie UR) it would also match and make the correct editions naming standard.
So

Code: Select all

{edition-X Y Z}

--

Code: Select all

{
	def value = tags.join(' ').replace('Uncut':'UC', 'Unrated':'UR')
	'{edition-' + value + '}'
}
Is that all being run in FileBot from the presets? I'm using presets
User avatar
rednoah
The Source
Posts: 21332
Joined: 16 Nov 2011, 08:59

Re: Plex Jellyfin Editions with Multi Tags / Matching

Post by rednoah »

e.g. you can of course come up with the list of tags with your own custom code:

Code: Select all

{
	def tags = fn.matchAll(/Uncut|Unrated/)
	def edition = tags.join(' ').replace('Uncut':'UC', 'Unrated':'UR')
	'{edition-' + edition + '}'
}
:idea: Note that matchAll() fails if there is no match, as opposed to successfully returning an empty list.



:idea: We're talking about custom formats here. You can use them in Presets which combine many different settings, a custom format being just one of the things that comprise a Preset.



:arrow: You absolutely want to prototype your custom formats in the Format Editor if you are not doing so already:

Image
:idea: Please read the FAQ and How to Request Help.
Post Reply