Page 1 of 1

Plex tv series naming and {} braces -- how do I do it?

Posted: 27 May 2021, 09:24
by Jorm
Hi,

Plex states "If you are using the “Plex TV Series” agent, you can optionally include the TMDB or TVDB show ID in the folder name to improve matching. If you choose to do that, it mustbe inside curly braces: ShowName (2020) {tvdb-123456} or ShowName (2020) {tmdb-123456} where 123456 is the show ID. An example can be found at the end of the article."

I've tried to escape the {} with the normal unix \ and with ' but to no avail filebot doesn't like it and I can't get it to name it {} and no don't think [] works even if prettier as plex expects {}.. tips to make it working highly appriciated..

Jorm

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 27 May 2021, 09:31
by rednoah
You can copy and paste this from the {plex} format examples:

Code: Select all

{plex.derive{" {tmdb-$id}"}}

You don't need to escape anything as far as I can tell:

Code: Select all

$ filebot -script fn:sysenv '{plex.derive{" {tmdb-$id}"}}'
...
# Arguments #
args[0] = -script
args[1] = fn:sysenv
args[2] = {plex.derive{" {tmdb-$id}"}}
:idea: Please read Cmdline and Argument Passing for details.


:idea: Note that {id} refers to the Series ID or Movie ID of your selected database, not necessarily TheMovieDB.



EDIT:

If Plex doesn't accept {tvdb-78874} patterns as part of the episode file name, then you can inject it into the series folder name like so:

Code: Select all

{plex[0..1]} {"{tvdb-$id}"}/{plex[2..3]}

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 27 May 2021, 18:13
by Jorm
Your right funny I could not get it to work yesterday, been ill the last week so guess I was just tired, thanks for the excellent support even to people how don't think lol.

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 28 Aug 2021, 11:21
by jkoopmann

Code: Select all

{plex.derive{" {tmdb-$id}"}}
I (believe) understand this. However, how do I use this in a --format expression in the cli? E.g. currently I use

Code: Select all

-- format "{ny.colon('-').ascii()}/{ny.colon('-').ascii()} ({imdbid}) ({resolution} {vc} {ac})" 
but (for Plex) I would love to have the brackets around the imdbid to be curly....

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 28 Aug 2021, 12:41
by rednoah
"..." has is interpreted by the shell, so you'll need to \" escape " or avoid " altogether.


:idea: Please read Cmdline and Argument Passing for details.


:idea: Use the @file syntax for reading command-line arguments from external text files.

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 28 Aug 2021, 14:51
by jkoopmann
Hi,

thanks.... but I seem to be too stupid. Sorry.


I tried putting things in a text file and use @file however this seems to conflict with the filebot.sh wrapper on FreeBSD.

Code: Select all

/usr/local/filebot/filebot.sh --format "{ny.colon('-').ascii()} ({imdbid}) ({resolution} {vc} {ac})" -non-strict --lang de --db TheMovieDB -rename *.mkv
works but puts the imdb in () brackets. What should the command line look like to put it in curly {} brackets? I would be very grateful to get a specific hint.

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 28 Aug 2021, 15:13
by rednoah
e.g.

Code: Select all

--format '{ny.colon("-").ascii()} {"{$imdbid}"} ({resolution} {vc} {ac})'
:idea: We use '...' to quote the argument, so that we can use "..." in the argument value.

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 23 Oct 2021, 21:01
by yodaspowart
Thanks rednoah, been wanting to know how to do this for a while:

Code: Select all

{"{imdb-$imdbid}"}

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 24 Oct 2021, 01:59
by rednoah
(requires FileBot 4.9.4 ​or higher) The {plex} format now has built-in support for {id-123} tags:

Code: Select all

{ plex.id }

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 31 Oct 2021, 06:22
by nyxtyr
Hello, I am also having a similar issue with the {} brackets not being able to output them to the filename.
I tried several things but unable to get it to output how I want it.

Code: Select all

'{'imdb-{'tt'+omdb.imdbId.pad(7)}'}'
"{"imdb-{'tt'+omdb.imdbId.pad(7)}"}"
'{imdb-{'tt'+omdb.imdbId.pad(7)}}'
"{imdb-{'tt'+omdb.imdbId.pad(7)}}"
\{imdb-{'tt'+omdb.imdbId.pad(7)}\}

Code: Select all

/TV Shows/{n} ({y}) imdb-{'tt'+omdb.imdbId.pad(7)}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{n} ({y}) - {episode.special ? 'S00E'+special.pad(2) : S00E00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}
Works almost perfectly but I want to add the {} to the imdb-tt1234567 part so it looks like {imdb-tt1234567}

Any help would be greatly appreciated. Thank you.

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 31 Oct 2021, 10:46
by rednoah
e.g.

Code: Select all

{"{imdb-tt${omdb.imdbId.pad(7)}}"}

Re: Plex tv series naming and {} braces -- how do I do it?

Posted: 31 Oct 2021, 17:47
by nyxtyr
rednoah wrote: 31 Oct 2021, 10:46 e.g.

Code: Select all

{"{imdb-tt${omdb.imdbId.pad(7)}}"}
Thank you this worked perfect for me. Updated code snippet below.

Code: Select all

/TV Shows/{ny} {"{imdb-tt${omdb.imdbId.pad(7)}}"}/{episode.special ? 'Special' : 'Season '+s.pad(2)}/{ny} - {episode.special ? 'S00E'+special.pad(2) : S00E00} - {t.replaceAll(/[`´‘’ʻ]/, /'/).replaceAll(/[!?.]+$/).replacePart(', Part $1')}{'.'+lang}