This agent detects local extras in a TV Show directory, and adds them to Plex. It’s quite a basic agent as it only supplies TV Extras, and nothing else. It can contribute to Personal Media Shows, TheTVDB and The Movie Database TV agents.
The extras can either be named in the form [title]-[extra type].ext or put into the named extra folders, as done when adding local extras for movies*; but the files or extra folders must be placed at the show level and not at the season level Edit: this restriction no longer applies, see the readme on github for more information.
I have only tested it on my own server (a Mac), but so far it works fine for my purposes. I probably won’t make any further changes to it, but everyone is free to download and alter it to fit their own needs.
Edit: LocalTVExtras.bundle.2.zip works for TV shows with a “Specials” folder
Edit 2: I’ve made the change suggested by @Matthiax, and LocalTVExtras.bundle.3.zip will now contribute to the HAMA metadata agent in addition to The TVDB, MovieDB and Personal Media Shows LocalTVExtras.bundle.3.zip (91.5 KB)
This looks very useful. One question, I note you say this only works at Show level, is that because you didn’t want it at Season level or is that it is not possible with the data model?
As far as I can tell, it isn’t currently possible to attach extras to a season.
During my first experiments I tried adding them using code along the lines of metadata.seasons[s].extras.add([plex extra object here]). If I inspect the plex database directly after testing the agent this way, then the extras were added and linked to the season, but they aren’t displayed in Plex/Web. My assumption is that it will eventually be possible to add extras at the season level but that it hasn’t been enabled yet in the different clients.
So this agent only adds extras at the show level. To avoid confusion, and potentially extras disappearing if you only do a partial refresh, I prevented the agent from searching for extras in season folders. You can reenable it searching there (if you want) by uncommenting line 7, but the extras found there will still be added at the show level.
I tried it on Windows 10 with my AppData moved to a different drive with no success. (Originally moved due to space limitations) Moving it back to the default location (%LOCALAPPDATA%\Plex Media Server) to see if it works. I’ll post my results afterwards.
Still can’t seem to get it working. These are the steps I’ve followed so far:
Download LocalTVExtras.bundle
Exit/Quit Plex
Copy that bundle to %LOCALAPPDATA%\Plex Media Server\Plug-ins
Start Plex
Navigate to Settings>Server>Agents>Shows
Toggle Local TV Extras Agent on inside the Personal Media Shows and TheTVDB tabs
Move extras (Behind The Scenes/Deleted Scenes) into a live media library
\Cartoons
\Robot Chicken
\Behind The Scenes
Behind The Scenes.mkv
Photo Gallery.mkv
\Deleted Scenes
Deleted Animatics.mkv
Deleted Scenes.mkv
\Season 1
Robot Chicken - s01e01 - episodeName.mkv
Robot Chicken - s01e02 - episodeName.mkv
\Specials
Robot Chicken - s00e01 - specialName.mkv
Robot Chicken - s00e02 - specialName.mkv
poster.jpg
8.Scan Library Files for the library (Cartoons)
9.Wait a minute for scan
10. Navigate into Show folder
11. No extras found beneath Seasons/Cast/Related Shows/More From studioName
I duplicated your folder structure and looked in the log file (com.plexapp.agents.localtvextras.log) and the problem is that I failed to account for different names for the Season sub-folders, and the last items scanned by the agent are in the Specials folder (If you wanted to check this quickly, you could rename “Specials” to “Season 0”).
To fix it properly, open up the bundle, go down to Contents > Code and open __init__.py in a text editor, then go to line 120, and change if os.path.basename(d).lower().startswith('season'):
to if os.path.basename(d).lower().startswith(('season','specials')):
You can also add any other names (series, for example) that you would use as season folders.
Once the file has been saved, go to your TV show, and refresh metadata - it is all done through the metadata agent, so scanning library files might not pick up the changes. The files should show up in Plex/Web just below the cast of the show.
I can’t test this on Windows, so if you continue to have problems, try looking for the log file in %LOCALAPPDATA%\Plex Media Server\Logs\PMS Plugin Logs\com.plexapp.agents.localtvextras.log. If it is finding the extras, then there should be log lines like INFO (__init__:81) - Found deleted extra: Deleted Scenes.mkv
Updated the code. Works like a charm now! I verified that it works on Windows 10 with metadata in the default location, and also with a custom location.
This is hands down the best solution for all of those dvd extras that haven’t had a place to call home. Thank you so much for this!
I also went and added another agent to contribute to on line 100: 'com.plexapp.agents.hama' I don’t know if you care to add it, but it just helps support Anime and is pretty commonly used.
I like the addition… I’ve long missed this function and started moving my non-specials tv show extras out of Plex for the lag of proper support.
Therefore: THANKS!!
that being said… I might be a little thick when it comes to using it.
I’ve installed v2 of the bundle and successfully deployed it.
I’ve activated it for all tv show agents
I’ve added some deleted scenes to one of my shows (adding a folder Deleted Scenes with 1 file Alternative Gags.mkv to the Season 01 folder)
re-scanned my library and waited…
When I didn’t get any results, I looked through my setup and found this critical error the plugin-log: 2018-04-01 00:06:26,785 (7f35dbf36700) : CRITICAL (sandbox:298) - Function named 'Start' couldn't be found in the current environment
Any idea how to address this? It’s no function triggered by your script directly.
I’m running my Plex Server on an Ubuntu 16.0.4 setup.
That line in the log isn’t an indication of any problem, I get that in mine too. in fact, if you look at the com.plexapp.agents.localmedia.log from the Plex local media agent, you’ll find the same line.
However, as discussed with @maiade, extras within the Season folders won’t be picked up unless you uncomment line 7 in __init__.py. And even then they will be added at the show level, because none of the Plex clients will display extras that are linked to the season (or at least none that I know of). Because of that, I’d suggest moving the Deleted Scenes folder one level up.
I’d also suggest a metadata refresh on the show you are testing, since the log file would normally state that no extras are found if the code was running. Scanning library files doesn’t necessarily prompt a metadata refresh, so that could be why nothing is being logged yet.
It appears refreshing the metadata did the trick. I’ve uncommented line 7 and changed some details of my test setup.
I’m looking at my DVD extras of 2 Broke Girls Season 6… folder looks as follows: TV Shows --- 2 Broke Girls (2011) --- --- ... --- --- Season 06 --- --- --- ... --- --- --- 2 Broke Girls (2011) - s06-e05.mkv ← regular episode, no extras --- --- --- 2 Broke Girls (2011) - s06e06.mkv ← episode 6 --- --- --- 2 Broke Girls (2011) - s06e06-deleted scene.mkv ← extra for episode 6 (deleted scenes) --- --- --- 2 Broke Girls (2011) - s06e07.mkv ← episode 7 --- --- --- 2 Broke Girls (2011) - s06e07-deleted scene.mkv ← extra for episode 7 (deleted scenes) --- --- --- ... --- --- --- Behind the Scenes --- --- --- --- Gag Reel.mkv
outcome:
Gag Reel is showing up twice as extra on the show level
*-deleted scene.mkv episode extras are showing as separate versions of the same episode (not as extras)
(sorry… pics are from German language UI)
outcome #1 is in line with your explanation… not yet sure about how to feel about #2
What surprises me (about your explanation but also Plex’ behavior):
Plex Web will show season based online extras… I’ve got some shows which include trailers for the entire show but also for seasons – where most of it is usually just some ad for a dvd release of a different season (but that’s a different discussion).
Edit: fixed the screenshots (downsizing of hiRes pics) and added.
PS: I stand corrected… no season extras in my Plex Web; must have had those confused or being stuck with wishful thinking. I had been reading in some Android related release notes that Plex will support tv show extras for shows, seasons and episodes (referring to the online content).
As far as 2 goes, try ‘deletedscene’ without any spaces instead of ‘deleted scene’ for the extra name.
The duplicate Gag reel appears to be a problem when the sub-folder searching is enabled. The agent finds the Behind the Scenes subfolder both while searching the Season 06 folder for extras, and while searching the show folder. I’ll have to have a think about that issue.
ick… now I’ve got the gag reel 3x.
no change about the episode extras – those still show as separate versions of the episode.
thanks for helping me with this… happy to act as a guinea pig to work out some of the quirks. I’m sad I’ll be of little help with the code… Python is a myth to me; maybe I need to change that
I believe the attached update should fix the Gag Reel duplicate problem. But if the agent is still supplying the same file path of any extra, then Plex won’t delete it - even if there are duplicates. So you’ll have to do a minor plex dance:
replace the agent
move the “Behind the Scenes” folder somewhere else.
refresh metadata on 2 Broke Girls
add the “Behind the Scenes” folder back
refresh metadata again
Based on my tests, this should only add a single gag reel, and further metadata refreshes won’t add any more duplicates.
I’ve double checked the Plex (movie) local media assets, and found that it should just be “xx-deleted.ext” rather than “xx-deleted scene.ext” or “xx-deletedscene.ext”. A double check in the agent code confirms that I copied that over without any changes. So try changing it to that convention.
ok… that’s fixing the duplicate entries (4 metadata refreshs, 1 to remove each of the versions + 1 after adding the behind the scenes extra).
The deleted scenes are now also showing up.
Question:
Are the episode extras supposed to show up on the show level?
Having the individual extras at their respective levels for show, season, episode would just be sweet
The tests I have done on my plex server (1.12.1.4885) indicate that it isn’t possible to add extras at the season level and have them visible - they are linked in the database but don’t show up in Plex/Web. So I have deliberately designed it to add everything at the show level.
If Plex later updates the clients to show extras at all levels, then it would be worth the more complex code to enable this; but at the moment I prefer to stick with the simpler version.
got it… still – great addition to fill this gap in the Plex.
from how this is currently designed… would it later be possible to handle episode extras by having a per-episode folder; e.g. Season 01 > 2 Broke Girls (2011) - s01e01 which could contain the actual episode 2 Broke Girls (2011) - s01e01.mkv as well as per-episode extra subfolders. This way you can give the extras actual titles instead of using just 2 Broke Girls (2011) - s01e01-deleted.mkv.