hd binding not evaluating to SD, HD or UHD on some files
Posted: 25 Apr 2019, 00:50
I have a naming scheme based on the {plex} binding that uses {plex.tail}. I do some processing to determine if a file is 4K or not and then put those files into a folder structure like this:
Sometimes, however, evaluating {hd} does not give me UHD or SD or HD, it returns NULL or maybe an empty string. I don't even know how to test for that it is returning or how to properly handle this possibility. My code that appends the file path then gets messed up and I wind up with access denied errors because the PATH I have built doesn't actually exist.
Here is a simplified version of my filebot script:
Here is an example of the issue:
output on the files in that folder showing that something is wrong with the UHD/HD/SD detection
this works well when using {plex.tail} as I am able to prefix the file path with '4K\tv' or '4K\movies' where necessary.4K\
..\movies
..\tv
movies\
tv\
Sometimes, however, evaluating {hd} does not give me UHD or SD or HD, it returns NULL or maybe an empty string. I don't even know how to test for that it is returning or how to properly handle this possibility. My code that appends the file path then gets messed up and I wind up with access denied errors because the PATH I have built doesn't actually exist.
Here is a simplified version of my filebot script:
Code: Select all
filebot -script fn:amc --def ut_dir="$PWD" --output /mnt/unionfs --action move -non-strict --order Airdate --conflict override --lang en --def ut_label=tv clean=y deleteAfterExtract=y "seriesFormat={hd =~ /UHD/ ? '4K/tv' : 'tv'}/{plex.tail} [{allOf{hd}{vf}{hdr}{bitdepth >= 10 ? {bitdepth}+'bit' : null}{vc}{af}{s3d}{source}{tags}{-group} join ', '}"
Here is the same code working on another file in that same folderRun script [fn:amc] at [Wed Apr 24 19:41:53 CDT 2019]
Parameter: ut_dir = /mnt/unionfs/TV Shows/Better Call Saul/Season 04
Parameter: ut_label = tv
Parameter: clean = y
Parameter: deleteAfterExtract = y
Parameter: seriesFormat = {hd =~ /UHD/ ? '4K/tv' : 'tv'}/{plex.tail} [{allOf{hd}{vf}{hdr}{bitdepth >= 10 ? {bitdepth}+'bit' : null}{vc}{af}{s3d}{source}{tags}{-group} join ', '}
Ignore hidden: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/.xattr
Ignore orphaned subtitles: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E01 - Smoke.eng.srt
Ignore orphaned subtitles: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E02 - Breathe.eng.srt
Ignore orphaned subtitles: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E03 - Something Beautiful.eng.srt
Ignore orphaned subtitles: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E04 - Talk.eng.srt
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E05 - Quite a Ride.eng.srt
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E05 - Quite a Ride.mkv
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E06 - Piñata.eng.srt
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E06 - Piñata.mkv
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E07 - Something Stupid.eng.srt
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E07 - Something Stupid.mkv
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E08 - Coushatta.eng.srt
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E08 - Coushatta.mkv
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E09 - Wiedersehen.eng.srt
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E09 - Wiedersehen.mkv
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E10 - Winner.eng.srt
Input: /mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E10 - Winner.mkv
Group: [Series:true] => [Better Call Saul - S04E05 - Quite a Ride.eng.srt, Better Call Saul - S04E05 - Quite a Ride.mkv, Better Call Saul - S04E06 - Piñata.eng.srt, Better Call Saul - S04E06 - Piñata.mkv, Better Call Saul - S04E07 - Something Stupid.eng.srt, Better Call Saul - S04E07 - Something Stupid.mkv, Better Call Saul - S04E08 - Coushatta.eng.srt, Better Call Saul - S04E08 - Coushatta.mkv, Better Call Saul - S04E09 - Wiedersehen.eng.srt, Better Call Saul - S04E09 - Wiedersehen.mkv, Better Call Saul - S04E10 - Winner.eng.srt, Better Call Saul - S04E10 - Winner.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Better Call Saul]
Fetching episode data for [Better Call Saul]
Auto-detected query: [Better Call Saul]
Fetching episode data for [Better Call Saul]
[MOVE] from [/mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E05 - Quite a Ride.mkv] to [/Better Call Saul/Season 04/Better Call Saul - S04E05 - Quite a Ride [6ch.mkv]
[MOVE] Failure: java.nio.file.AccessDeniedException: /Better Call Saul
Processed 0 files
AccessDeniedException: /Better Call Saul
Finished without processing any files
Abort (×_×)
Finally, here isFetching episode data for [Better Call Saul]
[MOVE] from [/mnt/unionfs/TV Shows/Better Call Saul/Season 04/Better Call Saul - S04E06 - Piñata.mkv] to [/mnt/unionfs/4K/tv/Better Call Saul/Season 04/Better Call Saul - S04E06 - Piñata [UHD, 2160p, x264, 6ch.mkv]
Code: Select all
filebot -mediainfo *.*
Here is fn:sysinfo outputBetter Call Saul - S04E01 - Smoke.eng [3840x2160 x264 5.1 EAC3 0:47 29.4 Mbps]
Better Call Saul - S04E02 - Breathe.eng [3840x2160 x264 5.1 EAC3 0:47 29.4 Mbps]
Better Call Saul - S04E03 - Something Beautiful.eng [1920x1080 x264 5.1 EAC3 0:41 10.6 Mbps]
Better Call Saul - S04E04 - Talk.eng [3840x2160 x264 5.1 EAC3 0:47 29.4 Mbps]
Better Call Saul - S04E05 - Quite a Ride.eng [ 5.1 EAC3 3:01 0.6 Mbps]
Better Call Saul - S04E05 - Quite a Ride [ 5.1 EAC3 3:01 0.6 Mbps]
Better Call Saul - S04E06 - Piñata.eng [3840x2160 x264 5.1 EAC3 0:47 29.4 Mbps]
Better Call Saul - S04E06 - Piñata [3840x2160 x264 5.1 EAC3 0:47 29.4 Mbps]
Better Call Saul - S04E07 - Something Stupid.eng [1920x1080 x264 5.1 EAC3 0:41 10.6 Mbps]
Better Call Saul - S04E07 - Something Stupid [1920x1080 x264 5.1 EAC3 0:41 10.6 Mbps]
Better Call Saul - S04E08 - Coushatta.eng [1920x1080 x264 5.1 EAC3 ]
Better Call Saul - S04E08 - Coushatta [1920x1080 x264 5.1 EAC3 ]
Better Call Saul - S04E09 - Wiedersehen.eng [1920x1080 x264 5.1 EAC3 0:55 6.8 Mbps]
Better Call Saul - S04E09 - Wiedersehen [1920x1080 x264 5.1 EAC3 0:55 6.8 Mbps]
Better Call Saul - S04E10 - Winner.eng [1920x1080 x264 5.1 EAC3 1:00 6.4 Mbps]
Better Call Saul - S04E10 - Winner [1920x1080 x264 5.1 EAC3 1:00 6.4 Mbps]
filebot -script fn:sysinfo
FileBot 4.8.5 (r6224)
JNA Native: 5.2.2
MediaInfo: 18.12
7-Zip-JBinding: 9.20
Chromaprint: java.io.IOException: Cannot run program "/usr/share/filebot/lib/fpcalc": error=13, Permission denied
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-04-09 (r559)
Groovy: 2.5.6
JRE: OpenJDK Runtime Environment 11
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 8 Core / 15 GB Max Memory / 40 MB Used Memory
OS: Linux (amd64)
HW: Linux xxxxxxxxxxxx 5.0.8-xanmod5 #1.190417 SMP PREEMPT Wed Apr 17 10:55:59 -03 2019 x86_64 x86_64 x86_64 GNU/Linux
DATA: /home/xxxxxxxxx/.filebot
Package: DEB
License: FileBot License T1015 (Valid-Until: 2019-08-04)
Done ヾ(@⌒ー⌒@)ノ