code help : plex + upper / replace ...

Any questions? Need some help?
Post Reply
mpegman
Posts: 19
Joined: 11 Feb 2023, 13:38

code help : plex + upper / replace ...

Post 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?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

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

Post 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() }
:idea: Please read the FAQ and How to Request Help.
Post Reply