Bug: Notify kodi/plex/etc skipped on custom action
Posted: 22 Mar 2020, 09:05
Using the amc script with options as follows
does not result in filebot sending the update video library command to my media box.
However, the following does work as expected:
As the only differences in the commands are the type of action being performed, I can only assume that the built in actions (in this case copy) set a flag if any files are processed to stop the media center being told to erroneously update it's library if no files were processed. Would it be possible to use the Exit Code of the custom action/script to determine if files were processed? As both windows and unix use 0 to indicate success this shouldn't be too hard. I haven't used java since Uni but a quick internet search yields the following code to check exit code:
amc.log snippets for both cases:
Code: Select all
filebot.sh -script fn:amc --output "/path/to/output" --log-file amc.log --action /bin/mv -non-strict "/path/to/input/" --def seriesFormat="/path/to/output/{n}/{'Season '+s}/{s00e00} - {t}" movieFormat="/path/to/output/{n}.{y}.{vf}" kodi="1.2.3.4:5678"
However, the following does work as expected:
Code: Select all
filebot.sh -script fn:amc --output "/path/to/output" --log-file amc.log --action copy -non-strict "/path/to/input/" --def seriesFormat="/path/to/output/{n}/{'Season '+s}/{s00e00} - {t}" movieFormat="/path/to/output/{n}.{y}.{vf}" kodi="1.2.3.4:5678"
Code: Select all
Process p = Runtime.getRuntime().exec("test.cmd");
p.waitFor();
System.out.println(p.exitValue());
Code: Select all
[/bin/mv] from [/path/to/input/Formula.1.Drive.to.Survive.S01.1080p.WEB.X264-AMRAP[rartv]/Formula.1.Drive.to.Survive.S01E10.1080p.WEB.X264-AMRAP.mkv] to [/path/to/output/Formula 1 Drive to Survive/Season 1/S01E10 - Crossing the Line.mkv]
Processed 20 files
Done ヾ(@⌒ー⌒@)ノ
Code: Select all
[COPY] from [/path/to/input/New.Amsterdam.2018.S02E17.1080p.WEB.H264-METCON[rarbg]/New.Amsterdam.2018.S02E17.1080p.WEB.H264-METCON.mkv] to [/path/to/output/New Amsterdam (2018)/Season 2/S02E17 - Liftoff.mkv]
Processed 1 files
Notify Kodi: [host:1.2.3.4, port:5678]
POST: http://1.2.3.4:5678/jsonrpc {"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"FileBot finished processing 1 files","message":"\u2022 New.Amsterdam.2018.S02E17.1080p.WEB.H264-METCON[rarbg]","image":"https://app.filebot.net/icon.png"},"id":1}
POST: http://1.2.3.4:5678/jsonrpc {"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}
Done ヾ(@⌒ー⌒@)ノ