AMC Specify plex library ID's for content based updates
Posted: 25 Apr 2018, 03:59
I'm not sure if the filebot documentation has been updated, but there is now a new way to generate permanent API tokens. I used the powershell method supplied in this post. I added echo $token to the end to view my resultant key.
I know AMC has native support for updating the plex library automatically, but unfortunately, that only uses HTTP (not HTTPS - so I have to configure plex to Prefer secure connections, instead of require them). On top of this, filebot is requesting an update of ALL libraries, instead of a specific library. With my collection that can take upwards of 5-7 minutes to finish scanning. I was hoping that we could update AMC to provide additional arguments for the respective plex libraries. Filebot already knows if something is a Movie/TV/Anime, so it shouldn't be too hard to only update that specific library.
I have manged to implement this functionality myself in my bash script, but I was hoping to have it become native as that is superior to my grep checks.
For my personal setup, Movies is library ID 1, TV is library ID 2, and Anime is library ID 12
Here is my args.txt file
Also, I'm a patreon subscriber, as well as an owner of the windows store app. (Gotta support the dev as much as I can) - Is there a way to hide the patreon message? It's cluttering my log files. Not a huge deal, but would be nice to hide.
I know AMC has native support for updating the plex library automatically, but unfortunately, that only uses HTTP (not HTTPS - so I have to configure plex to Prefer secure connections, instead of require them). On top of this, filebot is requesting an update of ALL libraries, instead of a specific library. With my collection that can take upwards of 5-7 minutes to finish scanning. I was hoping that we could update AMC to provide additional arguments for the respective plex libraries. Filebot already knows if something is a Movie/TV/Anime, so it shouldn't be too hard to only update that specific library.
I have manged to implement this functionality myself in my bash script, but I was hoping to have it become native as that is superior to my grep checks.
Code: Select all
#!/bin/bash
FILE_PATH=$1
filebot -script fn:amc \
-no-xattr \
--output "/home/user/Share" \
--log-file amc.log \
--action copy \
--conflict auto \
-non-strict \
"$FILE_PATH" \
--filter "!readLines('''/home/user/.filebot/filter.txt''').contains(n)" \
--def @/home/user/.filebot/args.txt
&&
if echo $FILE_PATH | grep -Eq 'Downloads/Movies|Share/Movies'; then
exec curl --insecure https://<plex_host>:<plex_port>/library/sections/1/refresh?X-Plex-Token=<plex-api-token>
elif echo $FILE_PATH | grep -Eq 'Downloads/TV|Share/TV'; then
exec curl --insecure https://<plex_host>:<plex_port>/library/sections/2/refresh?X-Plex-Token=<plex-api-token>
elif echo $FILE_PATH | grep -Eq 'Downloads/Anime|Share/Anime'; then
exec curl --insecure https://<plex_host>:<plex_port>/library/sections/12/refresh?X-Plex-Token=<plex-api-token>
fi
Here is my args.txt file
Code: Select all
music=n
clean=y
artwork=n
extras=n
unsorted=n
pushover=<key>:<token>
subtitles=en
musicFormat=Music/{n}/{album+'/'}{pi.pad(2)+' - '}{artist} - {t}
seriesFormat=TV/{plex.tail}
movieFormat={plex}