TheCaptain989 / radarr-striptracks

A Docker Mod to Radarr/Sonarr to automatically strip out unwanted audio and subtitle tracks
https://hub.docker.com/r/thecaptain989/radarr-striptracks
GNU General Public License v3.0
20 stars 1 forks source link

Running in batch mode - awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar `AudioCommand' as an array #68

Closed sikksakk closed 5 months ago

sikksakk commented 5 months ago

I'm trying to run the script in batch mode (directly on the cmdline, not in docker). i'm getting this error in console (also running directly on one single file): root@g25:~# find "/mnt/NAS/TV/The Show/" -type f \( -name "*.mkv" -o -name "*.avi" -o -name "*.mp4" \) | while read file; do ./striptracks.sh -f "$file" -a :eng:nor:und -s :eng:nor; done Info|Creating a new log file: ./striptracks.txt awk: cmd. line:61: (FILENAME=- FNR=5) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=5) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=5) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar 'AudioCommand' as an array awk: cmd. line:61: (FILENAME=- FNR=4) fatal: attempt to use scalar 'AudioCommand' as an array Log https://paste.mozilla.org/VCNPkEpc

Any idea what this could be?

TheCaptain989 commented 5 months ago

Hmmm. I'll take a look.

TheCaptain989 commented 5 months ago

I managed to reproduce the error. It's clearly and awk script issue, but the usual cause of this error ("attempt to use scalar as an array") is not the cause here... at least its not obvious to me and is eluding me at the moment. 😬

TheCaptain989 commented 5 months ago

I think I tracked this down. You can either pull the development version of the script, or you can add lines to striptracks.sh as detailed in the commit diff here: https://github.com/TheCaptain989/radarr-striptracks/commit/9f0089b91dc878bf652676ac4a752286cfeb29dc

The detailed debug log was incredibly helpful, BTW!

sikksakk commented 5 months ago

awesome, thank you for the fantastic support :-) Confirmed working! 🥳