DVD Order Agent

Question to the general public (those reading this thread anyway): Is anyone still developing (or still interested in developing) this agent? There’s an issue right now (best example: X-Files) where if you use the agent to fix a show, the show has a new or ongoing season that has not been assigned DVD ordering numbers yet in the TVDB, it’ll fail to match those items (obviously). With X-Files, that would be fixing season 4 and breaking season 10. It’d be great if it could somehow fall back on the Airdate ordering if DVD numbers are not found.

Anyone who does want to update this agent should probably work with the guys who made the github repo on the other thread: https://forums.plex.tv/discussion/193459/dvd-order-agent-theme-music-fix

@jooniloh I’m going to the (…) menu and selecting Unmatch, then clicking Fix Incorrect Match. Once I get to the search screen, I click Search Options, and choose TVDBdvdorder from the dropdown box. There are either no matches found, or it shows a match for the show, then when I click Confirm I end up with all the episodes without artwork or they revert to the incorrect setting. For example, The Scooby-Doo Show should show S01E01 as “A Bum Steer for Scooby” on the DVD order. Instead, it shows “High Rise Hair Raiser” as S1E01.

@bvogts You need to check the TVDB for issues like this. Your problem here is there are no DVD order numberings assigned to “The Scooby-Doo Show”. It doesn’t match (for example) Season 1, Episode 1 because according to the TVDB there is no Season 1, Episode 1 by the DVD order.

@jooniloh how did I not SEE that. Thank you. I just saw the episode names and thought, “Oh, cool, it has the DVD order!” Argh. So now that I feel foolish lol, what would you do in a situation like this where your rip source is the DVD? Just rename all the files to the TV order manually? I’ve seen a couple utilities floating around but none that claim to be able to automatically re-assign the episode number based on the title.

@bvogts said:
@jooniloh how did I not SEE that. Thank you. I just saw the episode names and thought, “Oh, cool, it has the DVD order!” Argh. So now that I feel foolish lol, what would you do in a situation like this where your rip source is the DVD? Just rename all the files to the TV order manually?

You could create an account with the TVDB and edit the episodes in their database to include the dvd order. I did this for a series that only had the tv order and it worked fine. It’s a little bit more effort but it will help others in the same situation and offers you a chance to give back to the community that’s helps provide his info.

Just be aware that the updates may not feed through right away to plex. When I did it it took a day or two for plex to update the episodes with the correct info.

@bvogts said:
@jooniloh how did I not SEE that. Thank you. I just saw the episode names and thought, “Oh, cool, it has the DVD order!” Argh. So now that I feel foolish lol, what would you do in a situation like this where your rip source is the DVD? Just rename all the files to the TV order manually? I’ve seen a couple utilities floating around but none that claim to be able to automatically re-assign the episode number based on the title.

@stripysocks said:

@bvogts said:
@jooniloh how did I not SEE that. Thank you. I just saw the episode names and thought, “Oh, cool, it has the DVD order!” Argh. So now that I feel foolish lol, what would you do in a situation like this where your rip source is the DVD? Just rename all the files to the TV order manually?

You could create an account with the TVDB and edit the episodes in their database to include the dvd order. I did this for a series that only had the tv order and it worked fine. It’s a little bit more effort but it will help others in the same situation and offers you a chance to give back to the community that’s helps provide his info.

Just be aware that the updates may not feed through right away to plex. When I did it it took a day or two for plex to update the episodes with the correct info.

Are the episodes on the DVD actually in a different ordering than the aired order? If so, then yes, you could edit the TVDB directly to reflect that.

As for renaming files to match the TVDB, you’re looking for FileBot. It can match to aired or DVD order on TVDB and the matching is very intelligent. I’ve thrown absolute ordering, numberless file names (episode name only), and a ton of other crazy things at it and it has almost always figured it out. And when it does fail, there’s always manual matching.

@jooniloh said:
Are the episodes on the DVD actually in a different ordering than the aired order? If so, then yes, you could edit the TVDB directly to reflect that.

Yeah, they are definitely in a different order. I created an account with TheTVDB but the entire series has been locked by another user. The episode names and correct DVD order are there, but the episode numbers are missing, at least for season 1. I guess my only recourse at this point is to manually renumber my files to match the TV order.

May have to post in the TVDB forums and get staff attention

Replace the bundle that comes with Plex with this one. On linux, that’s /usr/lib/plexmediaserver/Resources/Plug-ins-xxxxxxx/TheTVDB.bundle, where xxxxxxx is the short-rev Plex appends to the end of their version strings. You need to check out the feature/dvd-order branch (git checkout feature/dvd-order); the default branch (latest; the one that gets checked out automatically when you git clone) is just the code for the most recently shipped version of the agent (the plexinc-agents/TheTVDB.bundle repository isn’t up to date with production code). I update both branches automatically when installing a new version.

No need to switch agents for the shows that need DVD ordering. Go to Settings -> Server -> Agents -> Shows -> TheTVDB and click the gear next to the TheTVDB line to open the agent options. There’s a new field to enter a comma-separated list of TVDB series ID numbers to use DVD ordering for. For example if you have Firefly, and S01E01 in your folder is “Serenity” and not “The Train Job”, put 78874 in the field and then re-match the series (“fix incorrect match”).

Sorry, I haven’t added these instructions to the readme. Maybe I will, maybe I won’t. No promises. If it doesn’t work for you, figure out why and submit a pull request.

Mother of god! This works! thank you so much

Qwertz - For the rest of the world running Windows, how do I replace the TVDB bundle?

@Qwertz said:
GitHub - tgvarik/TheTVDB.bundle

@Qwertz said:
GitHub - tgvarik/TheTVDB.bundle

No need to switch agents for the shows that need DVD ordering. Go to Settings → Server → Agents → Shows → TheTVDB and click the gear next to the TheTVDB line to open the agent options. There’s a new field to enter a comma-separated list of TVDB series ID numbers to use DVD ordering for. For example if you have Firefly, and S01E01 in your folder is “Serenity” and not “The Train Job”, put 78874 in the field and then re-match the series (“fix incorrect match”).

Just tested and this doesn’t appear to work for me? I do see the entry for the series ID (I even used Firefly as my test show), but adding the series ID (78874) and “fix incorrect match” doesn’t get me the DVD order. :frowning:

Sorry, I haven’t added these instructions to the readme. Maybe I will, maybe I won’t. No promises. If it doesn’t work for you, figure out why and submit a pull request.

PR sent.

@rtm135: I will have to install Plex in a VM to figure that out for you. I will try to do that this weekend. It’s probably not the one described here. TheTVDB.bundle is a core plugin, and those are loaded from somewhere else, at least on Mac and Linux.

It would greatly simplify things if we could override a core plugin by placing an identically named bundle in the user plugins directory, but I have yet to experiment with that.

@patdavid I can think of a number of possibilities:

  1. If your files are mp4s and have incorrect metadata in them, Plex could be using that info preferentially. If this might be what’s happening, you can test by going to Settings -> Server -> Agents -> Shows -> TheTVDB and unchecking the “Local Media Assets (TV)” agent or making sure it’s below the “TheTVDB” agent. If you have bad metadata in your mp4s, you can purge it with something like AtomicParsley’s --metaEnema option. Plex doesn’t read metadata from mkvs, so if your files are mkvs, this is definitely not the problem.
  2. Plex might be caching and reusing the old metadata. Try removing the files from the library folder, then empty trash and clean bundles (both are in the “…” dropdown next to “Libraries” on the left sidebar in the home view). Double-check that the agent is set up correctly with 78874 in the DVD order field, and that your files are named correctly in DVD order (the file with “s01e01” in the title should be the 1h26m episode titled “Serenity”, not the 42m episode titled “The Train Job”), then put the files back in the Plex library folder and refresh the library.
  3. If you update the server, completely reinstall the patch. I haven’t fully investigated how Plex deals with plugins in prior-version core plugins folders, and there may be some weird interactions. Remove the old versioned core plugins folder Plug-ins-xxxxxxx for the prior version), because the upgrade won’t remove it for you due to unexpected extra files. Then reinstall the patch in the new version’s core plugins folder.
  4. If you’ve tried all that and it still doesn’t work, I’ll need to see com.plexapp.agents.thetvdb.log (usually in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs on Linux).

@Qwertz said:

Brilliant, thank you. I’ll find some time later to give this a more thorough look.

@Qwertz said:

@patdavid I can think of a number of possibilities:

  1. If your files are mp4s
    They are mkvs
  1. Plex might be caching and reusing the old metadata. Try removing the files from the library folder, then empty trash and clean bundles (both are in the “…” dropdown next to “Libraries” on the left sidebar in the home view). Double-check that the agent is set up correctly with 78874 in the DVD order field, and that your files are named correctly in DVD order (the file with “s01e01” in the title should be the 1h26m episode titled “Serenity”, not the 42m episode titled “The Train Job”), then put the files back in the Plex library folder and refresh the library.
    Removed from the library, emptied trash and cleaned bundles.
    Firefly s01e01.mkv is 1h26m (so should be serenity).
    Re-added to library path. Refresh. Still in aired order (the train job is s01e01). :frowning:
  1. If you’ve tried all that and it still doesn’t work, I’ll need to see com.plexapp.agents.thetvdb.log (usually in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs on Linux).
    Relevant log on pastebin:
    http://pastebin.com/eG77KVnf

Also, I greatly appreciate the help! :smiley:

I actually located the (hopefully) minor bug for me where metadata.id was not being cast as an integer for checking against the Prefs['dvd_order'] list. I just cast it and tested (appears to be wroking now). PR issued.

@Qwertz said:
GitHub - tgvarik/TheTVDB.bundle

just: awesome!

a couple of things:

C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-24ffd60

that is the folder I found for windows to put the plugin in, obviously the numbers may be different.

I’ve also found an issue that i’m not sure how to handle. On TheTVDB one of the shows was put on with a DVD order, but it has no season with the episodes, (the season is blank, but the show is locked so I can’t even add a 1 to it) so no matter how I name my files, while the show is found, it doesn’t name the episodes.

Specifically this one: http://thetvdb.com/index.php?tab=seasonall&id=73630&lid=7&order=dvd

@AndrewD2 said:
a couple of things:

C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-24ffd60

that is the folder I found for windows to put the plugin in, obviously the numbers may be different.

Incorrect.
That’s Plex’s ‘system’ plugins folder and is not meant for 3rd party stuff.
See Wiki article/question - How do I find the Plug-Ins folder?

Sorry, I’m unable/don’t know how to answer your 2nd issue.

@JamminR I’m guessing you haven’t been reading in the thread where it was asked how to override the current default TVDB plugin with the one @Qwertz linked to that is updated but not currently merged into the plex one.