{n.sortName('$2, $1')} renaming folder to ","

Support for Ubuntu and other Desktop Linux distributions
Post Reply
bulls23ant
Posts: 4
Joined: 04 Mar 2018, 17:03

{n.sortName('$2, $1')} renaming folder to ","

Post by bulls23ant »

Code: Select all

Ubuntu 16.04.5 LTS
FileBot 4.8.5 (r6224) / Java(TM) SE Runtime Environment 1.8.0_181 / Linux 4.4.121-1.el7.elrepo.x86_64 (amd64)
I'm running a script that includes {n.sortName('$2, $1')} which as I understand should rename to "movie name, the" but is instead renaming to ",". Here is the script:

Code: Select all

filebot -script fn:amc --output "/home/user/files/Filebot/Logs/" \
--action move -non-strict "/home/user/files/Finished/Process/" \
--log-file amc.log --def excludeList=amc.txt \
--def movieFormat="/home/user/files/Finished/Move/{n.sortName('$2, $1')}/{fn}" \
seriesFormat="/home/user/files/Finished/Move/{ny}/Season {s.pad(2)}/{fn}" \
--def clean=y \
--def subtitles=en,es
If I change {n.sortName('$2, $1')} for {ny} it renames the folder properly.

Script Output:

Code: Select all

Locking /home/user/.filebot/logs/amc.log
Dec 03, 2019 2:12:53 AM net.sf.ehcache.Cache <clinit>
SEVERE: Unable to set localhost. This prevents creation of a GUID. Cause was: hostname.cloud.seedboxes.cc: hostname.cloud.seedboxes.cc: Name or service not known
java.net.UnknownHostException: hostname.cloud.seedboxes.cc: hostname.cloud.seedboxes.cc: Name or service not known
	at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
	at net.sf.ehcache.Cache.<clinit>(Cache.java:222)
	at net.filebot.CacheManager.getCache(CacheManager.java:42)
	at net.filebot.Cache.getCache(Cache.java:29)
	at net.filebot.cli.ScriptSource.getCache(ScriptSource.java:127)
	at net.filebot.cli.ScriptSource$1.getScriptProvider(ScriptSource.java:31)
	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:162)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:37)
	at net.filebot.Main.main(Main.java:132)
Caused by: java.net.UnknownHostException: hostname.cloud.seedboxes.cc: Name or service not known
	at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
	at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
	at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
	at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
	... 8 more

Run script [fn:amc] at [Tue Dec 03 02:12:57 UTC 2019]
Parameter: excludeList = amc.txt
Parameter: movieFormat = /home/user/files/Finished/Move/{n.sortName(', ')}/{fn}
Parameter: seriesFormat = /home/user/files/Finished/Move/{ny}/Season {s.pad(2)}/{fn}
Parameter: clean = y
Parameter: subtitles = en,es
Argument[0]: /home/user/files/Finished/Process
Use excludes: /home/user/files/Filebot/Logs/amc.txt (1)
Input: /home/user/files/Finished/Process/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO.mkv
Group: [Movie:The Last Faust (2019), Series:null] => [The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO.mkv]
Get [English] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /home/user/files/Finished/Process/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO.mkv
Get [Spanish] subtitles for 1 files
Looking up subtitles by hash via OpenSubtitles
No matching subtitles found: /home/user/files/Finished/Process/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO.mkv
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/home/user/files/Finished/Process/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO.mkv]
[MOVE] from [/home/user/files/Finished/Process/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO.mkv] to [/home/user/files/Finished/Move/,/The.Last.Faust.2019.1080p.WEB-DL.H264.AC3-EVO.mkv]
Processed 1 files
Clean clutter files and empty folders
Done ヾ(@⌒ー⌒@)ノ
Output of filebot -script fn:sysinfo:

Code: Select all

filebot -script fn:sysinfo
Dec 03, 2019 2:01:25 AM net.sf.ehcache.Cache <clinit>
SEVERE: Unable to set localhost. This prevents creation of a GUID. Cause was:                                                                            hostname.cloud.seedboxes.cc: hostname.cloud.seedboxes.cc: Name or serv                                                                                    ice not known
java.net.UnknownHostException: hostname.cloud.seedboxes.cc: hostname                                                                                    .cloud.seedboxes.cc: Name or service not known
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
        at net.sf.ehcache.Cache.<clinit>(Cache.java:222)
        at net.filebot.CacheManager.getCache(CacheManager.java:42)
        at net.filebot.Cache.getCache(Cache.java:29)
        at net.filebot.cli.ScriptSource.getCache(ScriptSource.java:127)
        at net.filebot.cli.ScriptSource$1.getScriptProvider(ScriptSource.java:31                                                                                    )
        at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:16                                                                                    2)
        at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:37)
        at net.filebot.Main.main(Main.java:132)
Caused by: java.net.UnknownHostException: hostname.cloud.seedboxes.cc: Nam                                                                                    e or service not known
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:132                                                                                    3)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
        ... 8 more

Code: Select all

FileBot 4.8.5 (r6224)
JNA Native: 4.0.1
MediaInfo: 0.7.82
p7zip: p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,24 CPUs)
unrar: UNRAR 5.40 freeware
Chromaprint: fpcalc version 1.2.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-05-15 (r565)
Groovy: 2.5.6
JRE: Java(TM) SE Runtime Environment 1.8.0_181
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 24 Core / 26 GB Max Memory / 71 MB Used Memory
OS: Linux (amd64)
HW: Linux hostname.cloud.seedboxes.cc 4.4.121-1.el7.elrepo.x86_64 #1 SMP S                                                                                    un Mar 11 14:33:50 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
DATA: /home/user/.filebot
Package: DEB
License: FileBot License P9559033 (Valid-Until: 2020-10-06)
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: {n.sortName('$2, $1')} renaming folder to ","

Post by rednoah »

1.
Looks closely at the format that is actually passed into FileBot:

Code: Select all

Parameter: movieFormat = /home/user/files/Finished/Move/{n.sortName(', ')}/{fn}

Code: Select all

{n.sortName(', ')}
:idea: Please read Cmdline and Argument Passing for details.

:arrow: You're using "..." so $1 and $2 are interpreted by your shell, and expanded to empty string. You'll need to use '...' to pass $ literally. That also implies that the ' occurring literally in your format, will need to be escaped or replaced appropriately.

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



2.
This could be a problem, but I've never seen this before, so no idea, strange network misconfiguration?

Code: Select all

Dec 03, 2019 2:12:53 AM net.sf.ehcache.Cache <clinit>
SEVERE: Unable to set localhost. This prevents creation of a GUID. Cause was: hostname.cloud.seedboxes.cc: hostname.cloud.seedboxes.cc: Name or service not known
java.net.UnknownHostException: hostname.cloud.seedboxes.cc: hostname.cloud.seedboxes.cc: Name or service not known
:idea: Please read the FAQ and How to Request Help.
bulls23ant
Posts: 4
Joined: 04 Mar 2018, 17:03

Re: {n.sortName('$2, $1')} renaming folder to ","

Post by bulls23ant »

Thanks for the reply! I will look into the info you suggested.
Post Reply