Page 1 of 1
plex.tail.derive not working any more?
Posted: 01 Nov 2020, 16:49
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?
Re: plex.tail.derive not working any more?
Posted: 02 Nov 2020, 06:43
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}
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)
--encoding UTF-8 has no effect on
-script fn:renall or
-rename calls. It's only used for
-get-subtitles and
-check calls.
Re: plex.tail.derive not working any more?
Posted: 02 Nov 2020, 09:19
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
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
--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.
Re: plex.tail.derive not working any more?
Posted: 02 Nov 2020, 11:29
by rednoah
Yes, that should work.
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
Re: plex.tail.derive not working any more?
Posted: 02 Nov 2020, 11:54
by nls
rednoah wrote: ↑02 Nov 2020, 11:29
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.