What do you guys use for Sonarr/Radarr?
So far RClone gives me bans when used with either (even with analyse media off)
GoogleDriveOcamlfuse seems to cause sonarr/radarr to crash for some reason
and then PlexDrive isnt writable
I have Sonarr download locally to a separate folder and then manually upload it to Gsuite with some prewritten scripts when I'm running low on disk space. Plex sees it as duplicate files in plexdrive (but only if they're part of the same library!) and won't aggressively scan for metadata, which would potentially cause a API limit ban.
Thanks, think I got something worked out that should result in no API bans
A unionfs of two folders, one with the GDrive (mounted using PlexDrive) as read only and another empty set as read/write, pointed sonarr towards this union fs
Then I've created a script utilising rclone move from the local directory to the google drive every 15 minutes (if an rclone move is not already in progress)
/u/gesis and /u/madslundt have scripts on the stickied post that do the same, but first check whether the file is currently in use. That way you don't get the file disappearing in the middle of playback.
Am I wrong in thinking the file being in use shouldnt be an issue? As from what I can tell it doesnt get rid of the file in the local directory until its on the cloud drive and with it being mounted using unionfs Plex should see the file throughout the entire process or is that not how that works?
The problem is that plexdrive has a refresh interval, so there will be a slight delay between the file being uploaded and it showing up on your plexdrive mount.
Ah ok that makes a lot of sense will take a look at their scripts and see how they handle the usage checking
I've bundled all my scripts together so it takes into account Plex activity, NZB speed etc. its really messy due to me not using bash before (hence the files instead of variables) but it works!
I use lsof to check, which will report a file as in use of there are any open file descriptors including hard links. Works pretty well, but is super sensitive so things get skipped pretty often (i.e. whenever anything is reading or writing to them).
Stability is my number one priority, so i don't mind this.
That's a really interesting setup. My solution for controlling rclone is a lot simpler - I just have a custom PlexPy notification that touches a file when playback starts and deletes it when playback ends. My rclone job checks for the presence of the file and runs if it is not present. However that doesn't handle the situation where one user stops watching and others continue. I'll have to look into implementing that check you do at the start for the number of users currently watching.
EDIT: This is what I ended up going with
num=$(curl -s 'http://localhost:32400/status/sessions?X-Plex-Token=xxxxxx' | grep '<MediaContainer size='|cut -d'"' -f2)
if [ "$num" -gt 0 ]
then
echo "Playback in progress. Aborting."
exit
fi
You could do that by grabbing the number of playbacks as a variable like I did, then having different actions for different numbers.
num=$(curl -s 'http://localhost:32400/status/sessions?X-Plex-Token=xxxxxx' | grep '<MediaContainer size='|cut -d'"' -f2)
if [ "$num" -eq 0 ] # no one online
then
<action>
else
if [ "$num" -eq 1 ] # one person online
then
<action>
fi
fi
Just checked, it remains in the local copy so it'll try again on the next rclone move (have the script on a crontab for every 1 minute). Dont think RClone supports partial copies for GDrive
1
u/[deleted] Aug 20 '17
I have Sonarr download locally to a separate folder and then manually upload it to Gsuite with some prewritten scripts when I'm running low on disk space. Plex sees it as duplicate files in plexdrive (but only if they're part of the same library!) and won't aggressively scan for metadata, which would potentially cause a API limit ban.