Move subtitles to parent folder after download

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
redoXiD
Newbie
Newbie
Posts: 6
Joined: May 27th, 2022, 10:54 am

Move subtitles to parent folder after download

Post 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?
Last edited by redoXiD on May 29th, 2022, 5:24 am, edited 1 time in total.
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Move subtitles to main folder after download

Post 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 :)
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
redoXiD
Newbie
Newbie
Posts: 6
Joined: May 27th, 2022, 10:54 am

Re: Move subtitles to parent folder after download

Post by redoXiD »

Thank you very much, the quotes "" around the variable did the trick! Why didn't I think of that?! ;D
Post Reply