Plex Media Server Manager .NET

Hello Everyone,



Background

I’ve been a Plex Media Server user on both Windows and Linux for a couple of months now, I started out using used Windows Media Center switch to media portal for a few years and last 2 months I have switched to PMS because of the extra possibilities over Media Portal.



The goal

I would be 100% / absolutely happy with Plex Media Server if it allowed me to manage my library properly. What I mean with properly is that I have 3 sections full with media totaling over 30k media items. At that point the HTTP Management UI is not super effective when you manage large libraries. So I decided to start messing around and attempt to build a .NET management tool that will do the following:



Goals:

  • fast navigation, convenient navigation (tree style) of your libraries.
  • Fast way to manually match a series / move to one of plex’s scanners. (UI to search tvdb / or enter ID straight away)
  • Per Movie / Episode, directly see where the file is located at, the codecs used, the file name etc. (To easily verify matches).
  • Search libraries.
  • Change and input Meta Data.
  • Extra Feature: Search / Add / Check subtitle. Preferably integration to manually check if its syncs with video and adjust the timing.
  • Extra Feature: Allow the tool to search sources such as TVDB or Trakt to see if your missing any episodes.
  • Extra Feature: Allow watched flags to be imported to and FROM Trakt. (to make migration from other sources such as media portal easier).



    This is the first set of things I want to work on, last weekend I took some time to make a proof of concept and I was able to list the information and navigate through 1/3th of my library however with quite a slowdown when I added the second.



    Unknowns:

    The HTTP Api will almost certainly be too slow for large libraries to pre populate all seasons and episodes

    Using the Database directly runs the risk of corrupting the data and ruining the database.





    So thoughts / idea’s? would you want a standalone tool to manage your library?



    regards,

    Yuushi

I for one would welcome more choices in media management with Plex :slight_smile:



The HTTP API is designed to allow paging, so you can make use of that to improve speed, and it’s definitely the way to go (since it allows remote access).

I would love to have such a tool. I run PMS on a headless WHS 2011 maschine and get crazy with the slow speed when I work with the library


Ow my, that will speed thing up easily and make data interpretation q breeze aswell thnx!

Is that to say then that no "official" Windows application for the Server is in the pipeline? I don't think we are the only ones running PMS on headless Windows machines that are experiecing difficulties with the Web Manager.

Ok I can effectively load the series now in a timely matter especially if I add multi threads later for obtaining and parsing the XML. So in that regards things look great, I ran into the following:



http://predator:32400/library/metadata/7987/allLeaves


<Video ratingKey="8088" key="/library/metadata/8088" studio="NBC" type="episode" title="Dick's Giant Headache (2)" grandparentTitle="3rd Rock from the Sun" contentRating="TV-PG" summary="Reeling in the aftermath of his demotion, Dick has to get used to taking orders from everyone else in the crew -- even Harry -- a humiliating experience that makes it difficult for him to perform sexually. Even though she didn't want to believe the family's taunts about the reasons for her promotion, Sally finally realizes Stone only made her High Commander because of her looks. Stone makes a pass at Albright, who declines and tells Dick, who's psyched that Stone's changed his mind about Mary. Stone goes to the prom with Tommy and Alissa, where a drunken Stone dumps a punchbowl over Alissa's head, then serenades the promgoers -- including a bedazzled Vicki, who decided it was finally time to attend her junior prom -- with ""Close To You."" In the high school hallway, Stone encounters Vicki and ""beams"" her up to his ""bachelor pod"" for some lovin'. The next morning, Vicki turns up pregnant, and her pregnancy develops to full term in a matter of moments. Stone, who had been planning to make" index="24" parentIndex="4" rating="7" year="1999" thumb="/library/metadata/8088/thumb?t=1332757994" parentThumb="/library/metadata/8064/thumb?t=1332758016" duration="1274000" originallyAvailableAt="1999-05-25" addedAt="1332757161" updatedAt="1332757994"><Media id="7473" duration="1274000" bitrate="1123" width="512" height="384" aspectRatio="1.33" audioChannels="2" audioCodec="ac3" videoCodec="mpeg4" videoResolution="sd" container="avi" videoFrameRate="PAL" optimizedForStreaming="0"><Part key="/library/parts/7473/file.avi" duration="1274000" file="G:\Series\3rd rock from the sun\Season 04\3rd Rock from the Sun - s04e24 - Dick's Giant Headache (2).avi" size="183230464"/></Media><Writer tag="Michael Glouberman"/><Writer tag="Andrew Orenstein"/><Director tag="Terry Hughes"/></Video>




**Can anyone confirm that Index and ParentIndex are infact the season and episode number ? Even if a season is missing inbetween? so you have season 2 and season 4 but not season 3. Would the parent index of season 4 still be 4? I can't seem to confirm this in my own library because I don't have missing seasons.**

If you have a season missing of something go to the URL above of that show and see what the index is for me so I can make 100% sure this approach works otherwise I need to jump back in and see if I can tackle the problem differently.

Ow and a current screenshot :P Please keep in mind I haven't looked into layout / styles and whatever yet I just want to make sure I can get the actual navigation data the way I want.
![post-77473-0-12334100-1337110730.jpg|665x500](upload://7O76ZHV327AYdKZpmsep5KKJTcp.jpg)

I’ve just install plex today and was finding the media manager more than a little frustrating. I’ll keep a close eye on this project of yours! I’m also going to look into writing an alternative web interface, too.

Also keeping an eye on this project, good luck with it :slight_smile:

Especially for this!



(Please PM me if you'd like access to a developer chat room!)

The index attribute depends on what item you're looking at. For an episode, it's the episode number, and parentIndex is the season number


<br />
S03E05: index=5, parentIndex=3<br />




For a season, the index is the season itself.


<br />
S03: index=3<br />




Perfect that solves all of my current "issues" :)

Yuushi

Oh man gotta watch this topic, looks promising!



Question: will your app only work on a local LAN, or will it work with remote hosts (ie; not on your local subnet) as well?

The way I am planning now it will work aslong as you can browse your plex http service. So worst case you require a route and or port forward. That being said extra featurs I have in mind for my own use will mostlikey require the tool to be local or require access to physical media.



I would recommend using myPlex for remote access. It's quite simple to implement.

So y00sh00, any beta clients for people to test out for you? :smiley:

Very cool. I would be interested in testing this out as well!

I could also help testing :wink:



No sadly not, I am still running into some issues getting the info pre-populated (instead of loading the data when you click a season for example). Ive reworked the system a few times now but can't really come up with a solution that I really like. To give an example 500 series with episodes and seasons in a treeview take about 3 minutes to load which is kinda useless, but for it to be useful I don't want to load the episodes when the user clicks a season.

Bottom line I am still messing around with how to set up the very very very basic structure of the program. To a point where I wonder if I should start easy and start with movie manager as its mostly the sub tier of season that is messing stuff up.

Yuushi


Generally speaking, it's considered better to load the child items "on demand". People have huge TV libraries, and trying to populate a full tree view will just take way too long.


Yea that is certainly easier but is kinda where I disagree on better from a functionality point of view, I am used to having all my media items (on episode level) in one manager and able to search (real time textbox which filters the results), select them straight away. Furthermore as I want to be able to manage viewed status, missing episodes I need to have them populated anyway (for the supporting code for that). I am one of those people with huge tv libraries though so if I manage to get it working on mine it will probably work on others as well.

What I want to prevent is that I need to click series to be able to obtain missing or watched statuses for individual items. Even though at this initial loading will suffer due to wanting this.

TBH from what I can tell the actual loading part of 40k items is not such a big deal its the additional steps I have to make. ATM I almost have it pretty decently though especially if I manage to get to the part where I can optimize the speed, cut the results into pieces / pages and at a later point into multiple processing threads.
1. [Get all the sections] http://192.168.2.2:32400/library/sections/
2. [Get all the series] for each section http://192.168.2.2:32400/library/sections/{0}/all
3. [Get all the episodes] for each section http://192.168.2.2:32400/library/sections/{0}/allLeaves (Majority of the load, time should be acceptable with optimization)

The missing link here is that I would still need to call each series once to get the Seasons, which I would ideally have in 1 call or one of the earlier calls (2. or 3.). I would have expected them to be part of the allLeaves results or part of /children. **Basically my question is:** is there any way to ask the http api for a list of all seasons in a certain section which includes: season number, key of season, key of the parent (series). With that processing power will handle the rest. I was hoping http://192.168.2.2:32400/library/sections/1/search?type=3 would do the trick as I know the db uses type=3 for seasons but this doesn't seem to work. To clarify I am hoping to prevent having to use: http://192.168.2.2:32400/library/metadata/serieKey/children

If I am able to get it to work with 4 http requests initially then I am confident I can get the rest to work, I am also considering to just serialize the tree object into a binary file which is loaded every time the application starts and the periodically (scheduled or on demand) refresh this info. That would ensure startup is almost instant after the initial start and still keep sync with Plex Server and the local info. Additionally it has the nice advantage that you'd be able to browse your collection offline with restrictions (I still plan to load serie/movie metadata on click.)

Yuushi

There’s no way to request all the seasons in a section.



Philosophically, I have to respectfully disagree with the idea of downloading all the data and storing it offline :slight_smile: The search APIs are intended to provide live searching, and especially on a local network it should be plenty fast enough (and with compression, it should be fine over WAN as well).



However, that’s the beautiful thing about an API, people can do with it what they wish!