Not too long ago I setup SickBeard and SABNzb. Everything works wonderfully. It grabs all my tv shows automatically, renames them, puts them in the appropriate folders that Plex Media Server (PMS) is supposed to scan and find changes and auto add the content to my library. For some reason though, it doesn’t always work.
After searching through the Plex forums and other places online, I’ve found that the most common answer is to do a deep refresh. By default, Plex runs a Turbo Scan. From my understanding, it simply scans the folders in your library and checks their modified date. If that date has changed, then Plex will update that folder. A deep scan will scan the contents of the folder regardless of the modified date. For some reason, Plex Media Server isn’t detecting the changes when content is added from SABNzb and SickBeard. Running a deep scan always seems to find the new content and add it to the library. The only problem with that though is that you can’t set PMS to run a deep scan by default as opposed to the turbo scan. You have to manually run a deep scan by holding Option and clicking the Refresh button in PMS. What’s wrong with that? It requires an action from me. I set up SABNzb and SickBeard so I could have it ALL automated, not just the majority.
I’ve been playing around with launchd some this week for another Alfred extension to automatically sync bookmarks from Chrome back to Safari for searching with Alfred. PMS is set to automatically scan the folders for changes every 15 minutes. Why couldn’t I just find a way to automate a deep scan with launchd? You can. :)
I’ve got a little package working right now that you unzip and place in a folder. It can be any folder of your choice, but if you put it somewhere other than ~/Documents/Plex Deep Scanner, then you will have to go in and change the path to the files by hand. It’s not hard. Anyway, this little package comes with a launchd plist file, a scan.sh script, GrowlNotify so you can see when things are occurring, and a few other small scripts to install the plist, or to start/stop the script.
Basically, the plist tells launchd to run the scan.sh script every 15 minutes. The scan.sh script calls PMS from the command line and tells it to run a deep scan on my tv shows section in PMS. It can be modified to do my movies too. I just haven’t decided yet if I want that to be a separate script or to have them but run together.
If anybody is interested in more details or would like to try this setup, let me know and I can package it up and share it.