plex.tail.derive not working any more?

Support for Ubuntu and other Desktop Linux distributions
Post Reply
nls
Posts: 45
Joined: 19 Aug 2018, 21:07

plex.tail.derive not working any more?

Post by nls »

I had to reinstall my server after a crash, and had to reinstall Filebot as well with a new fresh license (old one expired anyway). I wanted to refresh my TV section for Plex, and I'm running into an issue. The `plex.tail.derive` expression below produces an empty string. `plex.derive` does work, but it's a different (deeper) structure that I don't need. What is the issue here?

Code: Select all

$ filebot -version
FileBot 4.9.2 (r8046) / OpenJDK Runtime Environment 15 / Linux 5.8.0-0.bpo.2-amd64 (amd64)

$ filebot --encoding UTF-8 -rename --db xattr --action symlink --format "/tmp/TV/{
        plex.tail.derive{
                def x = model.count{ [it.ext, it.episode, it.lang] == [ext, episode, any{m.lang.ISO2}{null}] }
                return x > 1 ? \" - part\$di\" : null
        }
}
" -script fn:renall ./
Also, `fn:renall` seems to be deprecated. What is the suggested script that does the same?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: plex.tail.derive not working any more?

Post by rednoah »

plex.tail.derive is incorrect.


Do plex.derive first:

Code: Select all

{plex.derive{" by $director"}{" [$vf, $vc, $ac]"}}
and then pick the tail section from the result of plex.derive:

Code: Select all

{plex.derive{" by $director"}{" [$vf, $vc, $ac]"}.tail}


:idea: You can probably remove the -script fn:renall call because it looks like a simple filebot -rename -r call will do just fine for your use case.
(EDIT: due to implementation details in how -rename and -script fn:renall work internally, {model} may yield different values in different use cases)


:idea: --encoding UTF-8 has no effect on -script fn:renall or -rename calls. It's only used for -get-subtitles and -check calls.
:idea: Please read the FAQ and How to Request Help.
nls
Posts: 45
Joined: 19 Aug 2018, 21:07

Re: plex.tail.derive not working any more?

Post by nls »

rednoah wrote: 02 Nov 2020, 06:43 plex.tail.derive is incorrect.
It used to work, you suggested using it IIRC.
rednoah wrote: 02 Nov 2020, 06:43 Do plex.derive first:

Code: Select all

{plex.derive{" by $director"}{" [$vf, $vc, $ac]"}}
and then pick the tail section from the result of plex.derive:

Code: Select all

{plex.derive{" by $director"}{" [$vf, $vc, $ac]"}.tail}
So

Code: Select all

--format "/tmp/TV/{
        plex.derive{
                def x = model.count{ [it.ext, it.episode, it.lang] == [ext, episode, any{m.lang.ISO2}{null}] }
                return x > 1 ? \" - part\$di\" : null
        }.tail
}" 
should work?
rednoah wrote: 02 Nov 2020, 06:43 :idea: You can probably remove the -script fn:renall call because it looks like a simple filebot -rename -r call will do just fine for your use case.
(EDIT: due to implementation details in how -rename and -script fn:renall work internally, {model} may yield different values in different use cases)
What I need is simple recursive rename. I'll try the suggesions.
rednoah wrote: 02 Nov 2020, 06:43 :idea: --encoding UTF-8 has no effect on -script fn:renall or -rename calls. It's only used for -get-subtitles and -check calls.
It was a long time ago, I can't remember why it's there. I'll try removing it.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: plex.tail.derive not working any more?

Post by rednoah »

Yes, that should work.


:idea: Since passing formats on the command-line can be somewhat cumbersome, you may prefer to pass in your format via a Groovy script file:

Code: Select all

--format /path/to/my-format.groovy
:idea: Please read the FAQ and How to Request Help.
nls
Posts: 45
Joined: 19 Aug 2018, 21:07

Re: plex.tail.derive not working any more?

Post by nls »

rednoah wrote: 02 Nov 2020, 11:29 :idea: Since passing formats on the command-line can be somewhat cumbersome, you may prefer to pass in your format via a Groovy script file:

Code: Select all

--format /path/to/my-format.groovy
I know, thanks. It's inside a shell script so it's fine there.

I remembered why I'm using renall. IIRC it's renaming per directory and provides a more useful directory structure. I'll keep using it, hopefully the script source is available in case you finally disable it after deprecation.
Post Reply