Renaming movies, {any}method with values + strings troubles

Any questions? Need some help?
Post Reply
IppoKun
Posts: 3
Joined: 04 Nov 2020, 16:57

Renaming movies, {any}method with values + strings troubles

Post by IppoKun »

I want to write in the filename either {imdb-XXXXX} or {tmdb-XXXXX} (or if none is available, write nothing at all) where the XXXXX is the correspondent id from that website.

Unfortunately using any with a string attached to an value will always value true and return, even if imdbid is null.

Example:

Code: Select all

{any{'{imdb-'+imdbid+'}'}{'{tmdb-'+tmdbid+'}'}} 
This will write

Code: Select all

imdb-tt null
if imdbid is not available.

I'm not familiar with this programming language so I'm having problems trying to figure it out
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming movies, {any}method with values + strings troubles

Post by rednoah »

:?: Please include the TheMovieDB link for the specific movie (i.e. one specific example for testing) you have trouble with.


Generally speaking, the {plex} format manual has you covered with examples:
rednoah wrote: 12 Sep 2016, 10:03 e.g. Movies/Avatar (2009)/Avatar (2009) {imdb-tt0499549}

Code: Select all

{plex.derive{" {imdb-$imdbid}"}}
e.g. Movies/Avatar (2009)/Avatar (2009) {tmdb-19995}

Code: Select all

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

e.g. if you want both ids:

Code: Select all

{plex.derive{" {imdb-$imdbid}"}{" {tmdb-$id}"}}
e.g. if you prefer one id but want the others as a default if the preferred one isn't defined:

Code: Select all

{plex.derive{ any{" {imdb-$imdbid}"}{" {tmdb-$id}"} }}

:idea: Please read How to Request Help.
:idea: Please read the FAQ and How to Request Help.
IppoKun
Posts: 3
Joined: 04 Nov 2020, 16:57

Re: Renaming movies, {any}method with values + strings troubles

Post by IppoKun »

Input: F:\Test\One.day.Dolores.was.on.her.own.2019.1080p.AMZN.WEB-DL.DDP2.0.H.264-TEPES.mp4
Match: https://www.themoviedb.org/movie/638137 ... quedo-sola

Command Line:

Code: Select all

filebot -script fn:amc --action test --conflict skip -non-strict "F:\Test" --def movieFormat="F:\Test\Library\{plex.derive{ any{\" {imdb-$imdbid}\"}{\" {tmdb-$id}\"} + \" [$fn]\"}.tail}" --def minLengthMS=0
Result:

Code: Select all

[TEST] from [F:\Test\One.day.Dolores.was.on.her.own.2019.1080p.AMZN.WEB-DL.DDP2.0.H.264-TEPES.mp4] to [F:\Test\Library\One day, Dolores was on her own (2019)\One day, Dolores was on her own (2019) {imdb-tt null} [One.day.Dolores.was.on.her.own.2019.1080p.AMZN.WEB-DL.DDP2.0.H.264-TEPES].mp4]
I want to show imdbid by default, unless imdbid is not available (which is this case). If imdbid is not available it should show tmdbid.
Unless I did something wrong, it still is showing {imdb-tt null}, it should show {tmdb-638137}
User avatar
rednoah
The Source
Posts: 19130
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Renaming movies, {any}method with values + strings troubles

Post by rednoah »

It works as far as I can tell:

Code: Select all

filebot -rename *.mp4 --db TheMovieDB -non-strict --action TEST --log INFO --format '{plex.derive{ any{" {imdb-$imdbid}"}{" {tmdb-$id}"} }.name}'
[TEST] from [One.day.Dolores.was.on.her.own.2019.1080p.AMZN.WEB-DL.DDP2.0.H.264-TEPES.mp4] to [One day, Dolores was on her own (2019) {tmdb-638137}.mp4]
I happen to be using the latest beta. Perhaps something is broken there in the recent release?
viewtopic.php?t=1609
:idea: Please read the FAQ and How to Request Help.
IppoKun
Posts: 3
Joined: 04 Nov 2020, 16:57

Re: Renaming movies, {any}method with values + strings troubles

Post by IppoKun »

I was using the last stable version (Windows non store version), I upgraded to the last beta version and now it is indeed working!

Code: Select all

Auto-detect movie from context [F:\Test\One.day.Dolores.was.on.her.own.2019.1080p.AMZN.WEB-DL.DDP2.0.H.264-TEPES.mp4]
[TEST] from [F:\Test\One.day.Dolores.was.on.her.own.2019.1080p.AMZN.WEB-DL.DDP2.0.H.264-TEPES.mp4] to [F:\Test\Library\One day, Dolores was on her own (2019)\One day, Dolores was on her own (2019) {tmdb-638137} [One.day.Dolores.was.on.her.own.2019.1080p.AMZN.WEB-DL.DDP2.0.H.264-TEPES].mp4]
Post Reply