Issues with ".derive"

Support for Windows users
Post Reply
jaruba
Posts: 4
Joined: 09 Dec 2020, 08:43

Issues with ".derive"

Post by jaruba »

I've recently started renaming my entire library in order to include tags for a chance at matching subtitles correctly. I found a github issue that suggested using the filename tags in brackets at the end of the filename, I still prefer using the `{plex}` shorthand though, so I ended up using: `{plex.derive{" [$vf $source $vc $group]"}}`

I'll explain my issue with an example. Presuming I have a file called "Something.S10E01.720p.AMZN.WEBRip.x264-GalaxyTV" (this is an actual case that failed and had no tags at the end), if I change the pattern to `{plex.derive{" [$source]"}}` (instead of the other pattern pasted above), it then leads to the file: "Something - S10E01 - ... [AMZN.WEBRip]".

It's bluntly obvious at this point that if even one of the variables is missing (vf, source, vc or group), then none of the tags are added to the end of the file at all.

So is there any way to add the tags at the end if at least one of them is available? Hopefully continuing to use the `{plex}` shorthand too?
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Issues with ".derive"

Post by rednoah »

e.g.

Code: Select all

{
	plex.derive{
		allOf{vf}{source}{vc}{group}.joining(' ', ' [', ']')
	}
}
:idea: viewtopic.php?t=1895
:idea: Please read the FAQ and How to Request Help.
jaruba
Posts: 4
Joined: 09 Dec 2020, 08:43

Re: Issues with ".derive"

Post by jaruba »

That works perfectly, thank you for the quick reply!
Post Reply