Page 1 of 1

Original File and folder name

Posted: 22 Feb 2017, 20:45
by saitoh183
I have a question about the CLI variables

So this is the output of a processed file:

Code: Select all

2017-02-22 01:27:25,693 - Media_Processing - DEBUG - StandardE: Locking /media/sdu1/home/saitoh183/private/script/Filebot.log
Run script [fn:amc] at [Wed Feb 22 01:03:11 GMT-05:00 2017]
Parameter: clean = y
Parameter: movieFormat = /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/{plex[1..-1]}
Parameter: ut_label = Movies
Parameter: exec =  ""python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp "{file}" -fr "{localize.french.name} ({y})" -en "{ny}"""
Argument[0]: /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies
{duration} => Expression yields empty value: Binding "duration": Native library (com/sun/jna/linux-x86-64/libjnidispatch.so) not found in resource path ([file:/media/sdu1/home/saitoh183/filebot/FileBot.jar])
Input: /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4
Group: [mov:manchester by the sea 2016] => [Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mkv/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4]
[MOVE] Rename [/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mkv/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4] to [/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester by the Sea (2016)/Manchester by the Sea (2016).mp4]
Processed 1 files
Execute: ""python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp "/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester by the Sea (2016)/Manchester by the Sea (2016).mp4" -fr "Manchester by the Sea (2016)" -en "Manchester by the Sea (2016)"""
There is a line says :
Input: /media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST/Manchester.By.The.Sea.2016.MULTi.1080p.BluRay.x264-LOST.mp4

After the file has been renamed, is there a variable that contains the input information above? I would want to pass that variable to the -exec

i currently use

Code: Select all

exec= \"\"python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp \"{file}\" -fr \"{localize.french.name} ({y})\" -en \"{ny}\"\"\"'
to get

Code: Select all

""python /media/sdu1/home/saitoh183/private/script/rclone_move.py -fp "/media/sdu1/home/saitoh183/private/Transfer/manage/movies/dualmovies/Manchester by the Sea (2016)/Manchester by the Sea (2016).mp4" -fr "Manchester by the Sea (2016)" -en "Manchester by the Sea (2016)"""

Re: Original File and folder name

Posted: 22 Feb 2017, 21:00
by rednoah
You can have the original filename via the {original} binding, but not the original file path.

If you want to do stuff with old/new path pairs, then you'll need to write shell script and check the history after the amc script is done:

Code: Select all

filebot -script fn:history
e.g.

Code: Select all

filebot -script fn:history | while IFS=$'\t' read -r FROM TO; do
	echo $FROM ➔ $TO
done

Re: Original File and folder name

Posted: 22 Feb 2017, 21:32
by saitoh183
rednoah wrote:You can have the original filename via the {original} binding, but not the original file path.

If you want to do stuff with old/new path pairs, then you'll need to write shell script and check the history after the amc script is done:

Code: Select all

filebot -script fn:history
e.g.

Code: Select all

filebot -script fn:history | while IFS=$'\t' read -r FROM TO; do
	echo $FROM ➔ $TO
done
cool, thanks i will have a look...i would have said filename would have been enough but sometime it is only the filepath folder that contains the movie name and the file name is random characters.

Re: Original File and folder name

Posted: 22 Feb 2017, 21:35
by saitoh183
saitoh183 wrote:
rednoah wrote:You can have the original filename via the {original} binding, but not the original file path.

If you want to do stuff with old/new path pairs, then you'll need to write shell script and check the history after the amc script is done:

Code: Select all

filebot -script fn:history
e.g.

Code: Select all

filebot -script fn:history | while IFS=$'\t' read -r FROM TO; do
	echo $FROM ➔ $TO
done
cool, thanks i will have a look...i would have said filename would have been enough but sometime it is only the filepath folder that contains the movie name and the file name is random characters.

Will this work on a headless server as well?

Re: Original File and folder name

Posted: 22 Feb 2017, 21:36
by rednoah
Why wouldn't it? It's a shell script. :lol:

Re: Original File and folder name

Posted: 22 Feb 2017, 22:32
by saitoh183
rednoah wrote:Why wouldn't it? It's a shell script. :lol:
:lol: stupid question...