Page 1 of 1

code help : plex + upper / replace ...

Posted: 03 Mar 2023, 19:52
by mpegman
I am looking for some coding help :

is there a possibility to have the output of the plex variable in uppercase ?
is it possible to have other operators run like .replace or .replaceAll?

following does not seem to work

Code: Select all

~ db.TheTVDB.plex  ** any{' ('+y+') '}{' (0000) '} * "[tvdbid-$id]".upper()
returns :

Code: Select all

Lost (2004) [TVDBID-73739]/Season 02/Lost - S02E07 - The Other 48 Days (2004)

Code: Select all

~ db.TheTVDB.plex.upper()   ** any{' ('+y+') '}{' (0000) '} * "[tvdbid-$id]"
or

Code: Select all

~ {db.TheTVDB.plex}.upper()   ** any{' ('+y+') '}{' (0000) '} * "[tvdbid-$id]"
returns nothing

I would like to get :

Code: Select all

LOST (2004) [TVDBID-73739]/SEASON 02/LOST - S02E07 - THE OTHER 48 DAYS (2004)
second question :
how do I make the subdirectories structure flat?

Code: Select all

LOST (2004) [TVDBID-73739] - S02E07 - THE OTHER 48 DAYS (2004)
any ideas?

Re: code help : plex + upper / replace ...

Posted: 04 Mar 2023, 04:10
by rednoah
{plex} is a File object so you need to convert it to a String object first if you want to apply String functions.

e.g.

Code: Select all

{ plex.id.path.upper() }


:idea: The {plex} format does not allow you to insert information between series name and SxE numbers in the file name. If this is what you want, then you need to write your own format:

Code: Select all

{ n.upper() } {"[TVDBID-$id]"} - {s00e00} - { t.upper() }