Page 1 of 1

rclone move after filebot renames

Posted: 30 Oct 2018, 12:52
by Arsia
I'm using the following script with Deluge

Code: Select all

#!/bin/bash

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"

TORRENT_PATH="$3/$2"
TORRENT_NAME="$2"
TORRENT_LABEL="N/A"

# Subtitle language
SUBLANG=en
SKIP_EXTRACT=n
MUSIC=y


filebot -script /opt/filebot/scripts/amc.groovy \
    --output "$HOME/media" \
    -non-strict --encoding utf8 --log all --log-file amc-deluge.log --action hardlink --conflict override \
    --def artwork=true ut_kind=multi "ut_dir=$TORRENT_PATH" "ut_title=$TORRENT_NAME" subtitles=$SUBLANG \
        extractFolder="$HOME/files/_extracted" music=$MUSIC skipExtract=$SKIP_EXTRACT &
I'd like to add something along the lines of:

Code: Select all

rclone move "$HOME/media/$3/$2" gdrive:/ -L --delete-empty-src-dirs
But as far as I can tell, that will move the directory straight into the root of / rather than inside /Movies, /Music, etc.

Thank you!

Re: rclone move after filebot renames

Posted: 30 Oct 2018, 17:35
by rednoah
You can use --def exec to call arbitrary commands after the amc script is done processing files.

e.g.

Code: Select all

--def exec="echo {quote f}"

Re: rclone move after filebot renames

Posted: 31 Oct 2018, 16:40
by tpc
Where might I find documentation for the {quote f} part of the exec command and any other replacement values that can be used here? For example, I am interested in getting the destination path without the filename.

Thanks!

Re: rclone move after filebot renames

Posted: 01 Nov 2018, 04:04
by rednoah
I think you mean {folder} which will give you the folder path of {f}. The quote(String...) helper function is particularly useful for --def exec expressions to quote argument values.

All the custom format expression documentation applies just the same, except that you'll be generating a command instead of a file path:
https://www.filebot.net/naming.html

:idea: You can use the GUI Format Editor to prototype --def exec expressions.

Re: rclone move after filebot renames

Posted: 01 Nov 2018, 15:36
by tpc
Thanks! I've used filebot command line for years but have never tried the GUI.