VideoFiles.py "helpfully" ignores folders called "extras
The VideoFiles.py file that ships with Plex ignores folders that include the word 'extras', thanks to an ignore_dirs array. Presumably this is so that DVD extras don't clutter up movie listings. It's extremely unhelpful when trying to keep the popular BBC series 'Extras' in my library.
I've manually modified the file, removing the 'extras' regex from the array, but something helpfully overwrites my changes with the pristine file, and my series disappears again.
On OSX, the file in question is: ~/Library/Application\ Support/Plex\ Media\ Server/Plug-ins/Scanners.bundle/Contents/Resources/Common/VideoFiles.py
I've got a custom scanner installed already, for other reasons, but I don't know where to put a customized version of VideoFiles.py so that it will be used, nor how to stop Plex from re-disappearing my series.
I think I’ve found a solution for this. In ~/Library/Application Support/Plex Media Server/Scanners, I created a Common directory and put my slightly-modified VideoFiles.py in there. That seems to have worked.
Interesting that I’ve been trying to figure out this exact same thing today. Except I’m trying to exclude qHD (quarter HD) from the file name. Please let me know if you figure this out.
Finally figured out a way around this. I had to add a custom path to search for the import files.
Copied /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Scanners.bundle/Contents/Resources/Common/
to
/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Scanners/Common/
Now, inside the new Common directory, I copied VideoFiles.py to VideoFilesCustom.py
Modifiy VideoFilesCustom.py to how you see fit.
The only file that needs to be modified in the Common directory is Stack.py. Run the following so that is now references the new VideoFilesCustom.py file.
sed -i ‘s/VideoFiles/VideoFilesCustom/g’ Stack.py
Make sure all the permissions are correct in the files here. For me:
chown plex:nogroup *
Now go into the Scanners/Movies/ folder.
Modify your custom movie scanner. I took the original one and copied it to this folder and renamed it to:
Plex_Movie_Scanner_Custom.py
Modify your custom scanner:
You will need to change all references of VideoFiles to VideoFilesCustom:
sed -i ‘s/VideoFiles/VideoFilesCustom/g’
Now the piece to add the path for your import to the new Common directory you made:
Here are the relevant lines for my file:
import re, os, os.path, sys
sys.path.append("/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Scanners/Common")
import Media, VideoFilesCustom, Stack, Utils
Check your permissions again.
Note: You probably don’t need to copy all of the files from the original Common to the new one. You probably only need the renamed version of VideoFiles.py to make this work.
I feel like doing it in this manner is using a sledge hammer to drive in a penny nail.
Because of how crucial to properly pick up the files in one’s library, the developers should add a method to modify this in the web settings under Advanced for a individual library. This is far too complicated to fix for something that should be be fundamental part of a scanners job.
This came up recently in Chat for slightly different reasons and I just stumbled on this thread.
If your show folder for "Extras" is at the top level of your TV section (which is recommended for TV organization/naming anyway), then it will not be skipped by the scanner. So, if you name it like this, e.g.:
TV Root Directory/Extras/Season 1/Extras - S01E01.mkv
you should be fine. I would also be curious to know if there's a compelling reason to have show folders lower in the hierarchy than that.
mmccurdy, I don't know how compelling my reason is, but I have 3.96TB of television file split across three external hard disks. The disks themselves are 1, 2, and 3TB. Looking at the distribution now, I could consolidate things onto just two drives, but not one.
A consequence of my need to split things up is that I split the files into functional groupings: Animation, British TV, Cable TV, Reality TV, and Television. Somethings this is a happy consequence, and sometimes it's a pain, but I'm hard-pressed to think of how I could get everything into a single folder so I could have a "TV Root Directory." So instead I have five.
So for me, it's: /Volumes/Marvin/British\ Television/Extras/Extras - Season 1 (2005)/Extras - 1x01 - Ben Stiller.avi
And Plex periodically updates things and disappears Extras again. :(
Sorry, I didn't mean that you needed to have a *single* root directory, you can have more than one. I think I see your problem though. Just remove the word "Extras" from the Season directory, so instead of "Extras - Season 1 (2005)" just call it "Season 1."
Since you're in the code anyway, if you're interested, here's the logic that adds that list of ignores to everything *except* things directly in the root of the section:
The problem is, when it scans that Season directory, it's not at the root of the section, it's one directory down (under "Extras"), so it filters it out. Make sense?