Local TV Extras Agent

I’m glad the agent is working well for you for adding and playing extras, thanks for letting me know :slight_smile:

You’re correct that the extras aren’t editable within the Plex Web interface like the main library files, any changes have to be made through the agent. Custom art is possible already and display titles (distinct from the file name) are something I’m considering how to add, but I don’t think summaries will be possible with the agent API as it is.

For custom art, I use an inline thumbnail image in the same folder with the same name as the extra (except for extension). This will only be added when adding it as a fresh extra, so if you want to do this then you’d have to move the extra from the folder, do a metadata refresh, then add it and the thumbnail back to the folder before refreshing again.

At the moment, the display title is taken from the file name (similar to extras in Plex’s local media agent). This has some limitations (e.g. characters that are forbidden in various file systems), so I’ve been considering some workarounds but all are fairly cumbersome so far.

Summary hasn’t been displayed for extras on any of the clients I have used, so I only tried to investigate this yesterday. As far as I can tell, it isn’t possible to add a summary for extras either through the agent API or the Plex XML API. The only way I have found is through manually editing the entry in the metadata_items table of the com.plexapp.plugins.library.db file, which isn’t a practical solution.

1 Like

I have recently discovered this plug-in. It seems like the answer I have been asked for years.

I have installed as instructions and enabled it on All TV Shows through the Agents settings. However, I cannot get it work.

Here is a folder structure.

  • [TVShow Root]/
    • Season 00/
    • Season 01/
    • Season 02/
      • Star Blazers 2199 - S02E01 - AD 2202 – Revive, Space Battleship Yamato [1080p_BluRay].mkv
      • Star Blazers 2199 - S02E02 - Tension – Reach the Embassy on the Moon [1080p_BluRay].mkv
      • Extras/
        • Space Battleship Yamato 2202 Menu 01.mkv
        • Space Battleship Yamato 2202 Menu 02.mkv

I have tried to both enabled and disabled “Assign Extras to Episodes, Seasons or Shows based on folder structure” and moved the “Extra” folder to the root of the tv show. None of them works.

Please help.

I’ve tried to duplicate your folder structure with the extras, the steps I have taken are:

  1. Create the folder structure for the show only, including one episode each in Season 00 and Season 01, and the two episodes you named in Season 02
  2. Allow Plex to match this TV show via the default TVDB agent
  3. Add the Extras folder with two mkv files within the Season 02 folder
  4. With the extra setting Assign Extras to Episodes, Seasons or Shows based on folder structure left disabled, refresh metadata within the show
  5. Two extras then appear on the show level below the cast in Plex Web

If I enable the Assign Extras to Episodes, Seasons or Shows based on folder structure setting then the extras disappear from the show level. They don’t appear in Season 2 in Plex Web (since it doesn’t support season or episode extras), but when I check Season 2 in the xml API, the extras are linked.

Since it seems to be working for me, could you please refresh metadata on your show and then upload the com.plexapp.agents.localtvextras.log file here, so I can see if there are any errors.

@contrary_cat
I have tried to refresh metadata and voila! They appear on my Show. Thank you very much for your help! Your plug-in is invaluable!

I deeply appreciate your effort! Sorry for wasted your time.

Cheers,
Entropy

I’m having an issue where I can’t get it to work without creating a new folder for the extras, something I can’t do because I’m sharing this and can’t change folder structure.
If I understood correctly just by having the filename end in -extra.ext or -extra_type.ext it should work, right?
This is my folder structure right now

And it’s not showing as an extra, rather it takes it as an episode

But while checking the log it shows the agent recognizes the extras but figures it has already added both.


2019-09-13 23:13:01,789 (188c) :  INFO (logkit:16) - Folder name, To LOVE-Ru Darkness doesn't include "Season", "Specials" (or any alternative specified in settings) so it must be a Show Folder
2019-09-13 23:13:01,789 (188c) :  INFO (logkit:16) - Not searching for season 0 extras, extras will only be added at the show level.
2019-09-13 23:13:01,790 (188c) :  INFO (logkit:16) - directories are: F:\Anime\To LOVE-Ru Darkness
2019-09-13 23:13:01,790 (188c) :  INFO (logkit:16) - Folder name, To LOVE-Ru Darkness doesn't include "Season", "Specials" (or any alternative specified in settings) so it must be a Show Folder
2019-09-13 23:13:01,790 (188c) :  INFO (logkit:16) - directory to search for extras: F:\Anime\To LOVE-Ru Darkness
2019-09-13 23:13:01,790 (188c) :  INFO (logkit:16) - Looking for local extras in path: F:\Anime\To LOVE-Ru Darkness
2019-09-13 23:13:01,792 (188c) :  INFO (logkit:16) - Extra NCED has already been added
2019-09-13 23:13:01,792 (188c) :  INFO (logkit:16) - Extra NCOP has already been added
2019-09-13 23:13:01,792 (188c) :  INFO (logkit:16) - added 0 extras
2019-09-13 23:13:01,792 (188c) :  INFO (logkit:16) - finished

Refreshed metadata, did a Plex Dance, and it still hasn’t shown the files as extras.

EDIT: Had an epiphany a minute after posting and did a Plex Dance with JUST the extra files and after Refreshing metadata it worked, leaving this here just in case this solves the issue for someone else

And just as a FYI, you could add things to that folder in the file system and you can rename the folder and each of the files if desired in the torrent app, which changes them locally, without affecting sharing.

I could rename the files individually but not move some files to a different subfolder
Maybe I should look it up

I’m having trouble getting the agent to pick up episode extras. I’m trying to add the extras using the first Episode Extras option: episode organized its own subdirectory, extra added to subdirectory as an inline extra.

The structure is:

  • TV Shows
    • The X-Files
      • Season 7
        • The X-Files - s07e02 - The Sixth Extinction (Part 2) - Amor Fati
          • The Sixth Extinction II Armor Fati-deleted.mp4
          • The X-Files - s07e02 - The Sixth Extinction (Part 2) - Amor Fati.avi

If “Assign Extras to Episodes, Seasons or Shows based on folder structure” is deselected then the localtvextras log says that it finds the deleted extra and it shows up at the show level.

But if the setting is on then the log says:

2019-10-13 14:07:38,774 (700010b1b000) :  INFO (__init__:159) - Searching for extras for episode: S7E2
2019-10-13 14:07:38,774 (700010b1b000) :  INFO (__init__:90) - Looking for local extras in path: /Users/mschmitt/Downloads/CrashPlan Excluded/Plex Media/TV Shows/The X-Files/Season 07/The X-Files - s07e02 - The Sixth Extinction (Part 2) - Amor Fati
2019-10-13 14:07:38,774 (700010b1b000) :  INFO (__init__:132) - added 0 extras
2019-10-13 14:07:38,774 (700010b1b000) :  INFO (__init__:133) - finished

Thanks for reporting the problem, @mschmitt. I’ve confirmed that it is a bug and pushed a fix to github. Hopefully it will work for you now :slight_smile: .

It works!

I’m having trouble after recovering my database from a failing disk, I updated the agent to make sure it would be recognized. And it does, but it shows the files both as extras and as actual episodes. Here are the logs. Did a Plex Dance, Emptied the Trash and Refreshed Metadata, but it still picks them up as episodes AND extras at the same time. I’m using it with Hama, btw.

>  2019-11-18 02:02:01,720 (10c8) :  INFO (logkit:16) - Folder name, Hibike! Euphonium doesn't include "Season", "Specials" (or any alternative specified in settings) so it must be a Show Folder
> 2019-11-18 02:02:01,720 (10c8) :  INFO (logkit:16) - directory to search for extras: E:\Media\Series\Hibike! Euphonium
> 2019-11-18 02:02:01,720 (10c8) :  INFO (logkit:16) - Looking for local extras in path: E:\Media\Series\Hibike! Euphonium
> 2019-11-18 02:02:01,721 (10c8) :  INFO (logkit:16) - Found short extra: NCED
> 2019-11-18 02:02:01,723 (10c8) :  INFO (logkit:16) - Found short extra: NCOP
> 2019-11-18 02:02:01,723 (10c8) :  INFO (logkit:16) - Found short extra: Ready, Set, Monaka
> 2019-11-18 02:02:01,723 (10c8) :  INFO (logkit:16) - Found short extra: The Everyday Life of Band Part 1 Cleaning Instruments!
> 2019-11-18 02:02:01,723 (10c8) :  INFO (logkit:16) - Found short extra: The Everyday Life of Band Part 2 I Can`t Stand This Nickname!
> 2019-11-18 02:02:01,723 (10c8) :  INFO (logkit:16) - Found short extra: The Everyday Life of Band Part 4 All Hail King Tuba!
> 2019-11-18 02:02:01,723 (10c8) :  INFO (logkit:16) - Found short extra: The Everyday Life of Band Part 5 Lots of Problems Every Day!
> 2019-11-18 02:02:01,724 (10c8) :  INFO (logkit:16) - Found short extra: The Everyday Life of Band Part 6 Professor Taki`s Secret!
> 2019-11-18 02:02:01,724 (10c8) :  INFO (logkit:16) - Found short extra: The Everyday Life of Band Part 7 What Is a Transposing Instrument!
> 2019-11-18 02:02:01,724 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\NCED-short.mkv
> 2019-11-18 02:02:01,726 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\NCOP-short.mkv
> 2019-11-18 02:02:01,726 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\Ready, Set, Monaka-short.mkv
> 2019-11-18 02:02:01,726 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 1 Cleaning Instruments!-short.mkv
> 2019-11-18 02:02:01,726 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 2 I Can`t Stand This Nickname!-short.mkv
> 2019-11-18 02:02:01,726 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 4 All Hail King Tuba!-short.mkv
> 2019-11-18 02:02:01,726 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 5 Lots of Problems Every Day!-short.mkv
> 2019-11-18 02:02:01,727 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 6 Professor Taki`s Secret!-short.mkv
> 2019-11-18 02:02:01,727 (10c8) :  INFO (logkit:16) - E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 7 What Is a Transposing Instrument!-short.mkv
> 2019-11-18 02:02:01,727 (10c8) :  INFO (logkit:16) - added 9 extras
> 2019-11-18 02:02:01,727 (10c8) :  INFO (logkit:16) - finished

When I check one episode it looks like this

But then it shows on the Extras section again

EDIT: I’m leaving Scanner logs too, just in case it’s a conflict between both

Nov 18, 2019 02:01:50.600 [5084] DEBUG - Performing a scan with 'Absolute Series Scanner' (language: en virtual: 0).
Nov 18, 2019 02:01:50.600 [5084] DEBUG -   * Scanning E:\Media\Series\Hibike! Euphonium
Nov 18, 2019 02:01:50.601 [5084] DEBUG - Scanner: Processing directory E:\Media\Series\Hibike! Euphonium (parent: yes)
Nov 18, 2019 02:01:50.608 [5084] DEBUG - File 'E:\Media\Series\Hibike! Euphonium\NCED-short.mkv' didn't exist, can't skip.
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\NCED-short.mkv]
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Path matched, we're reusing media item 1798575
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\NCOP-short.mkv]
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Path matched, we're reusing media item 1798576
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\Ready, Set, Monaka-short.mkv]
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Path matched, we're reusing media item 1798577
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 1 Cleaning Instruments!-short.mkv]
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Path matched, we're reusing media item 1798578
Nov 18, 2019 02:01:50.748 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 2 I Can`t Stand This Nickname!-short.mkv]
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Path matched, we're reusing media item 1798579
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 3 The Everyday Life of Band Dudes!.mkv]
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Path matched, we're reusing media item 1798580
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 4 All Hail King Tuba!-short.mkv]
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Path matched, we're reusing media item 1798581
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 5 Lots of Problems Every Day!-short.mkv]
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Path matched, we're reusing media item 1798582
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 6 Professor Taki`s Secret!-short.mkv]
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Path matched, we're reusing media item 1798583
Nov 18, 2019 02:01:50.755 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\The Everyday Life of Band Part 7 What Is a Transposing Instrument!-short.mkv]
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Path matched, we're reusing media item 1798584
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 01 [BD][1080p-FLAC][C4EDD669].mkv]
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Path matched, we're reusing media item 1776899
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 02 [BD][1080p-FLAC][614DABDD].mkv]
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Path matched, we're reusing media item 1776900
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 03 [BD][1080p-FLAC][C46959B0].mkv]
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Path matched, we're reusing media item 1776901
Nov 18, 2019 02:01:50.760 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 04 [BD][1080p-FLAC][5D119675].mkv]
Nov 18, 2019 02:01:50.765 [5084] DEBUG - Path matched, we're reusing media item 1776902
Nov 18, 2019 02:01:50.766 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 05 [BD][1080p-FLAC][958C0CD9].mkv]
Nov 18, 2019 02:01:50.767 [5084] DEBUG - Path matched, we're reusing media item 1776903
Nov 18, 2019 02:01:50.767 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 06 [BD][1080p-FLAC][FDEC76A5].mkv]
Nov 18, 2019 02:01:50.768 [5084] DEBUG - Path matched, we're reusing media item 1776904
Nov 18, 2019 02:01:50.768 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 07 [BD][1080p-FLAC][E31D4F10].mkv]
Nov 18, 2019 02:01:50.769 [5084] DEBUG - Path matched, we're reusing media item 1776905
Nov 18, 2019 02:01:50.769 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 08 [BD][1080p-FLAC][34ABAEAB].mkv]
Nov 18, 2019 02:01:50.770 [5084] DEBUG - Path matched, we're reusing media item 1776906
Nov 18, 2019 02:01:50.770 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 09 [BD][1080p-FLAC][8EFF0C04].mkv]
Nov 18, 2019 02:01:50.771 [5084] DEBUG - Path matched, we're reusing media item 1776907
Nov 18, 2019 02:01:50.772 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 10 [BD][1080p-FLAC][49BE8284].mkv]
Nov 18, 2019 02:01:50.772 [5084] DEBUG - Path matched, we're reusing media item 1798480
Nov 18, 2019 02:01:50.773 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 11 [BD][1080p-FLAC][E65EB3C2].mkv]
Nov 18, 2019 02:01:50.774 [5084] DEBUG - Path matched, we're reusing media item 1776909
Nov 18, 2019 02:01:50.774 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 12 [BD][1080p-FLAC][20B8419B].mkv]
Nov 18, 2019 02:01:50.775 [5084] DEBUG - Path matched, we're reusing media item 1776910
Nov 18, 2019 02:01:50.775 [5084] DEBUG - Looking for path match for [E:\Media\Series\Hibike! Euphonium\[FFF] Hibike! Euphonium - 13 [BD][1080p-FLAC][59F01287].mkv]
Nov 18, 2019 02:01:50.776 [5084] DEBUG - Path matched, we're reusing media item 1798481
Nov 18, 2019 02:01:50.776 [5084] DEBUG - HTTP requesting PUT http://127.0.0.1:32400/activities/?percentComplete=%2B0&subtitle=Hibike!%20Euphonium
Nov 18, 2019 02:01:50.778 [5084] DEBUG - HTTP 200 response from PUT http://127.0.0.1:32400/activities/?percentComplete=%2B0&subtitle=Hibike!%20Euphonium
Nov 18, 2019 02:01:50.802 [5084] DEBUG - HTTP requesting PUT http://127.0.0.1:32400/activities/?percentComplete=100.000000
Nov 18, 2019 02:01:50.814 [5084] DEBUG - HTTP 200 response from PUT http://127.0.0.1:32400/activities/?percentComplete=100.000000
Nov 18, 2019 02:01:50.814 [5084] DEBUG - Removing 0 media items that were left.
Nov 18, 2019 02:01:50.814 [5084] DEBUG - Removing 0 directories that were left.
Nov 18, 2019 02:01:50.814 [5084] DEBUG - Updating directory 'Hibike! Euphonium' (ID 1038915) to time 2019-11-18 01:59:12.
Nov 18, 2019 02:01:50.828 [5084] DEBUG - Refreshing metadata for 'Hibike! Euphonium' (agent: com.plexapp.agents.hama)

So if I understand it correctly, the extras agent isn’t misidentifying anything that shouldn’t be an extra, but extras are being identified as episodes. The Plex scanner ignores any files with -extratype at the end, but it seems that the absolute series scanner doesn’t exclude them and the Part 1, Part 2, etc. are being interpreted as episode numbers.

I don’t know the absolute series scanner very well, so I’m not certain if this will work, but you could try using the sub-folder method instead. I’d suggest removing the problem extra files, emptying trash & cleaning bundles. Once the duplicate episodes have been removed from the database, create the a “short” sub folder, add the extras to that folder and then refresh metadata on the show.

Thanks! It somehow worked for those numbered extras but the Opening and Ending still showed up as episodes.

Then I deleted and reinstalled the scanner and refreshed metadata and it worked.
Thanks for your patience!

Hi Contrary_Cat I’m excited to get this working and think it might be but so far the clients I have tried aren’t showing anything. I’ve tried plex web on windows and Ubuntu, and Client on iOS. I have not checked on my Samsung tv yet. But if I interpret the log correctly (attached here) the plugin is working. Could you please review and confirm what I’m thinking. The only place I have an extras at the moment is Stargate SG-1 Season 1 using the folder method. Thanks for your help. com.plexapp.agents.localtvextras.log (161.1 KB)

Yes, the log confirms that the extras have been correctly added. The problem you have is one of client support: Plex Web will only show extras at the show level and the iOS client only displays extras that are linked to an episode.

For Windows/Ubuntu at least, there is an alternative: if you download kodi and install the Plex for Kodi addon, that will show the season level extras.

Same exact problem here with the extras and also using Plex client on the Nvidia Shield. Once playback ends or if you stop playback, the Plex client crashes. This seems limited to the Shield maybe? I’m not sure, but pretty annoying regardless :thinking:

After moving to a new server on a Qnap and reinstalling the plugin, configuring it in agents and then restarting everything to make sure everything stuck, I get nothing from any client. No extras in any of my shows. Previously on my Mac, it worked, without thumbnails, but it worked. any clues?

I’m assuming that the agent shows up in Settings > Agents?

If yes, please navigate to one of the shows where you have extras, refresh metadata on that show, then once the refresh is complete, upload the log (either here or github) - that should help me see if something’s gone wrong in the code.

Plex Media Server Logs_2020-01-26_15-59-10.zip (4.1 MB)

After several restarts and meta refreshes it now seems to work. Yay!