Page 1 of 1

Move subtitles to parent folder after download

Posted: May 29th, 2022, 5:19 am
by redoXiD
Hi there,

I'm trying to automate my SABnzbd setup (running on QNAP) using a post-processing script.
As part of this, I would like to move my subtitle files out of the /Subs/* folder to the parent directory, as Plex doesn't support this type of structure.

So far, this is my script:

Code: Select all

#!/bin/bash
cd $1
find . \( -path "*/Subs/*" -o -path "*/subs/*" -o -path "*/SUBS/*" \) -print -exec mv {} ./ \; && find . -type d -empty -delete
echo Done
The command works fine in the command line but unfortunately not in SABnzbd. The problem is probably this:

Code: Select all

/share/Download/SABnzbd Scripts/filebot-shows.sh: line 2: cd: /share/video/Serien/Moon: No such file or directory
Actually, this should be ".../Moon Knight/" and not ".../Moon". The files are sorted using SABnzbd with this expression: "%sn/S%0s/%dn"

Is there anything I could do about this isssue other than using a file path without spaces?

Re: Move subtitles to main folder after download

Posted: May 29th, 2022, 5:23 am
by safihre
You could also set the option "Ignore folders inside archives" in Config Switches, this prevents any directories from being formed.
You can use " around the variable I think, but not a bash epert
Maybe somebody else here can help you with that :)

Re: Move subtitles to parent folder after download

Posted: May 29th, 2022, 5:33 am
by redoXiD
Thank you very much, the quotes "" around the variable did the trick! Why didn't I think of that?! ;D