Page 1 of 1

filebot can't use existing script (renall)

Posted: 30 Nov 2022, 19:32
by nls
It's been a while since I ran a scan for my TV shows and since then, there was an OS upgrade as well (Debian 10->11). There's this command I use in one of my scripts but now it refuses to work, and I don't fully understand why.

Code: Select all

filebot --encoding UTF-8 -rename --db xattr --action symlink --format "$SYMLINK_TEMP_BASE/$TARGET_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
}
" -script fn:renall "$PATH_TV"
I get this error:

Code: Select all

Starting filebot rename pass...
Script not found: [renall] not in [amc, artwork, artwork.tmdb, artwork.tvdb, chkall, cleaner, configure, duplicates, explain, extract, history, import, lib/htpc, lib/web, logs, mediainfo, mi, miss, nfo, osdb.explain, osdb.stats, preferences, properties, suball, sysenv, sysinfo, tags, update-mes, verify, watcher, xattr, zip]
Failure (×_×)⌒☆
Version:

Code: Select all

FileBot 4.9.4 (r8736) / OpenJDK Runtime Environment 16.0.2
Could you give hints on what's wrong? The groovy script does exist:

Code: Select all

$ ls -l ~media/filebot/scripts/renall.groovy
-rw-r--r-- 1 media media 640 Aug 18  2018 /home/media/filebot/scripts/renall.groovy

Re: filebot can't use existing script (renall)

Posted: 30 Nov 2022, 22:48
by nls
Just to note, this works:

Code: Select all

 ... -script /home/media/filebot/scripts/renall.groovy ...

Re: filebot can't use existing script (renall)

Posted: 01 Dec 2022, 03:03
by rednoah
:!: The renall script has been discontinued and removed years ago because it served no particular purpose that isn't better served by standard filebot commands or other scripts. -script fn:name and -script dev:name refer to scripts in the script repository and not local files. You can of course run your own local scripts.



:?: Why are you not just using filebot -rename instead?

Code: Select all

filebot -rename -r "$PATH_TV" --db xattr --action symlink --output "$SYMLINK_TEMP_BASE/$TARGET_TV" --format /path/to/format.groovy
/path/to/format.groovy

Code: Select all

{
        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
}
:idea: Use the @file syntax for reading command-line arguments from external text files. Not strictly necessary, but passing complex arguments on the command-line is best avoided.

Re: filebot can't use existing script (renall)

Posted: 01 Dec 2022, 10:52
by nls
Thanks for the hints. I don't remember why I used the renall script in my shell script, I wrote it several years ago. All I want is to create symlinks that follow the Plex naming requirements in a temp directory, then in a separate step I convert all the generated symlinks absolute in the final target dir, since IIRC abs. links are not supported with filebot. I'll follow your recommendations WRT changing the command line script into an external one, it looks cleaner.

Re: filebot can't use existing script (renall)

Posted: 01 Dec 2022, 11:19
by rednoah
:idea: Re-organize previously organized files using local xattr metadata is been added to the docs as general example for this kind of use case.



:idea: You can configure FileBot to create absolute symlinks like so with somewhat recent versions:

Code: Select all

filebot -script fn:properties --def net.filebot.symlink=absolute
** Not sure when this was added. Maybe 2-3 years ago.



EDIT:

We might replace net.filebot.symlink in favour of a dedicated --action AbsoluteSymlink if the use case where to come up more often, especially on Windows. On Linux and macOS, all custom use cases are generally covered via the --action /path/to/custom-shell-script.sh option. I've added a create-absolute-symlinks example to the docs.

Re: filebot can't use existing script (renall)

Posted: 01 Dec 2022, 11:54
by nls
I'm using xattrs to store metadata so this might be a good fit. It also seems there are changes in functionality that make my life a bit easier. I'll try what's best for my use case, thanks.