Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

[REL] Extended Personal Media Shows Agent

mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

This metadata agent should be used with the Extended Personal Media Scanner found here. See the instructions on this page for installing the scanner.

This is a Metadata Agent for personal media files. It works in conjunction with the Extended Personal Media Scanner to scan personal media shows. The meta data agent sets the summary details on the episode. The agent expects the files to follow the naming conventions for personal media that are outlined in the Plex documentation.

Date-numbered shows

One major difference between the Extended Media Shows scanner and the Plex Series Scanner is that the Extended Media Shows scanner creates episode numbers for all of the date-based media. This results in it being sorted correctly in all Plex user interfaces. The episode number is the day of the year in which the episode is dated plus the optional index value. If an index value is not specified then a one (1) is automatically appended to the end of the episode number.

Plex date-based naming standard:

/Home Movies
   /Christmas
      /2010
         Christmas - 2010-01-06 - Getting Ready.m4v
         Christmas - 01-07-2010 - Getting Ready.m4v
         Christmas - 2010-12-24 - Stuffing_the_Stockings.m4v
         Christmas.12-25-2010.Christmas.Morning.m4v

Additional supported formats:

If the season title is specified it should go in the season description. Right now this is not working. I'm looking into why this failing.

/Home Movies
   /Christmas
      /2010
         2010-01-06 - Getting Ready.m4v
         12-24 - Stuffing the Stockings.m4v
      /2011 - Season title
         2011-01-06 - Some.title.m4v
         12-24 - Some_other_title.m4v

The above example would result in a show with Christmas as the show title. The season number, episode number and episode title would be parsed from the names.

Unstructured format:

Additionally the scanner and metadata agent also support unstructured content as well. What this means is that you could put all of your files in the same folder as long as the file name format looks like the following:

/Home Movies
   /Holidays
      /Christmas - 2011-12-25 - Getting Ready.m4v
      /Christmas - 2010-12-24 - Santa Claus.m4v
   /Birthdays
      /Grandma - 2010-02-24 - Grandma's 77th birthday party.m4v
      /Grandma - 2008-02-24 - Grandma's 75th birthday party.m4v

The above example would result in shows with Christmas and Grandma as the show titles. The season number, episode number and episode title would be parse from the names.

Multiple episodes/shows on the same day:

With this plug-in it is possible to have multiple shows on the same date. An example of where this might be used in storing multiple NFL games in a directory with the same date. The Plex Series Scanner will see these as the same episode and will give them the same episode title. The Extended Personal Media scanner and agent allow the user to specific an index number after the date to specify that the episode is different. This results in Plex showing the episode with the appropriate title.

/Sports
   /NFL
      /2013
         01-06_1 - Patriots Vs Giants.m4v
         01-06_2 - Houston Vs Minnesota.m4v
         2013-01-06_3 - Oakland Vs St. Lious.m4v

In the example of above three separate episode would be created in Plex and each with their own name.

Episode-number based shows

Plex episode-based naming standard:

/Home Movies
   /Christmas
      /2010
         Christmas - s2010e0106 - Getting Ready.m4v
         Christmas - s2010e0225 - Stuffing the Stockings.m4v
         Christmas - s2010e1225 - Christmas Morning.m4v

Additional supported formats:

If the season title is specified it should go in the season description. Right now this is not working. I'm looking into why this failing.

/Home Movies
   /Christmas
      /2010
         s2010e01 - Getting Ready.m4v
         e02 - Another episode.m4v
      /2011 - Season title
         s2010e01 - Getting Ready.m4v

The above example would result in a show with Christmas as the show title. The season number, episode number and episode title would be parsed from the names.

Episodes that contain episode release dates:

The following shows the different supported directory/file formats that are supported by the plug-in.

/Home Movies
/NFL - s2015e01 - 2015-12-31 - Minnesota vs Green Bay.mp4
/NFL - s2015e02 - 12-31-2015 - Detroit vs Tampa Bay.mp4
/NFL
/s2015e03 - 2015-12-31 - New England vs New York Jets.mp4
/s2015e04 - 12-31-2015 - San Francisco vs Seattle.mp4
/s2015
/e05 - 2015-12-31 - Arizona vs Dallas.mp4
/e06 - 12-31-2015 - New York Giants vs Philadelphia.mp4
/e07 - 2015-12-31 - Cincinnati vs Pittsburgh.mp4
/e08 - 12-31-2015 - Episode Title.mp4

The above example would result in a show with NFL as the show title. The season number, episode number, episode release date and episode title would be parsed from the names. The example shows 8 episodes specified above each would show up having the release date of 12-31-2015 in Plex.

Unstructured format:
/Home Movies
   /Holidays
      /Christmas - s2010e01 - Getting Ready.m4v
   /Vacations
      /Italy - s2010e01 - Getting Ready.m4v

The above example would result in shows with Christmas and Italy as the show titles. The season number, episode number and episode title would be parsed from the names.

Using Chapter instead of Season:

Additionally the plugin supports using "Chapter" and "C" instead of "Season" and "S" (case is ignored). Note: the word "Season" would still be used in the Plex user interface and cannot be changed by the metadata agent plugin.

/College Classes
   /Physics 101
      Physics 101 - c1e1 - First chapter.m4v
      Physics 101 - c1e2 - 2nd chapter.m4v
      /C2
         e1 - Some notes.m4v
         e2 - Some more notes.m4v
      /Chapter3
         e1 - Something else.m4v
         e2 - Something more.m4v
         e3 - Something real.m4v

The above example would result in 7 episodes being added under three seasons with a show name of "Physics 101".

Show summaries

Show summaries can be added to media files in Plex by creating a file with the show name and a ".summary" extension somewhere within the directory path of your media file that you want to add the summary to. It is important to note that the show summary file found will be used as the summary information for the show.

There are two formats supported for show summary files:

  • [Show title].summary where [Show title] is the name of your show that you want the summary information to be added to
  • show.summary

Example media file:

/Media Root/Show title/Show title - 2010-02-02 - Some title.mp4

Summary file:

/Media Root/Show title/Show title.summary

Episode summaries

Episode summaries can be added to media files in Plex by creating a file with the same name and a ".summary" extension in the same directory as the media file you want to add the summary to.

Example media file:

Show title - 2010-02-02 - Some title.mp4

Summary file:

Show title - 2010-02-02 - Some title.summary

Download and source

Download: https://bitbucket.org/mjarends/extendedpersonalmedia-agent.bundle/get/master.zip

Source: https://bitbucket.org/mjarends/extendedpersonalmedia-agent.bundle/src

Installation

  • Unzip the downloaded ZIP file, this gives you a file/folder with the name ExtendedPersonalMedia-Agent.bundle-master. Rename the folder to ExtendedPersonalMedia-Agent.bundle
  •  
    • Mac
      • Move ExtendedPersonalMedia-Agent.bundle to ~/Library/Application Support/Plex Media Server/Plug-ins. The easiest way to find this folder is to use the Go to folder... option in the Go menu of the Finder.
        ~ is your home folder. If you can't find your Library folder, have a look at OS X Lion: Where did my Library go?
    • Windows
      • Move ExtendedPersonalMedia-Agent.bundle to the Plug-ins folder: right-click the Plex Media Server icon in the system tray and open the Plug-ins folder
    • Linux (Ubuntu)
      • Move ExtendedPersonalMedia-Agent.bundle to /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins
      • cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins"
      • sudo chown -R plex:plex ExtendedPersonalMedia-Agent.bundle
  • Restart Plex Media Server (this is optional)
       - On Mac and Windows: just quit and start again
       - On Linux (Ubuntu): sudo service plexmediaserver restart
  • In the Plex/Web application go to Settings > Server > Agents > Shows > Extended Personal Media Shows. Ensure that the Local Media Assets (TV) agent is checked and showing in the list (see the screen capture). The Local Media Assets is needed to add subtitle or metadata attributes from the files to your media.

  • In Plex/Web (the media manager), create a new "TV Shows" section and select Extended Personal Media Shows  from the Agent dropdown menu (under Advanced Options).

Plug-in Logs Location

This section details the plug-in log file and location on the different operating systems. Please send this log file to me so that I can perform additional analysis.

Plug-in log file name: com.arendshome.plex.agents.personalmedia.log

The following shows where the PMS Plugin Logs directory is on the different operating systems.

  • Mac: ~/Library/Application Support/Plex Media Server/Logs/PMS Plugin Logs
  • Windows: C:\Users\<USER NAME>\AppData\Local\Plex Media Server\Logs\PMS Plugin Logs
  • Linux: Open /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins

Change Log:

4/4/2015: Updated plug-in to fix issue with plug-in using the wrong parsed meta data within Plex due to the multi-threading of the metadata agents

5/29/2015: Added support for the following formats:

  • \Show Title - s2012e09 - 2015-12-31 - Episode Title.mp4
  • \Show Title - s2012e09 - 12-31-2015 - Episode Title.mp4
  • Show Title\s2012e09 - 2015-12-31 - Episode Title.mp4
  • Show Title\s2012e09 - 12-31-2015 - Episode Title.mp4
  • Show Title\s2015\e09 - 2015-12-31 - Episode Title.mp4
  • Show Title\s2015\e09 - 12-31-2015 - Episode Title.mp4
  • Show Title\e09 - 2015-12-31 - Episode Title.mp4
  • Show Title\e09 - 12-31-2015 - Episode Title.mp4
1/6/2016: Added support for two digit episode index numbers in date-based episodes (ex: \Show Title - s2012e09 - 2015-12-31_25 - Episode Title.mp4. (NOTE: Updating the plug-in and rescanning your library will result in new episode numbers being created)

2/28/2016: Added support for show .summary files

2/29/2016: Fixed issue with 2/28/2016 release. Added support for show.summary file format. Added preferences to enabled/disable debug logging within the plugin.

1/5/2017: Fixed bug with Personal Media Shows Agent where it wouldn't pick up .summary files and go into an infinite loop while traversing paths due to the bug with double / and never finding root directory. Thanks @m3ki
«13456714

Comments

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    I have a question for other developers. How do you set the way in which the date based episodes are sorted within a season? I have tried setting the index and absolute_index values on the Episode metadata object and neither has resulted in the episodes being sorted differently. The reason that I am asking is that date based episodes in Plex (both the web and Android clients) are sorted according to their name and not by their episode number (which is the date). Do you need to create a scanner that handles the date based episodes differently?

  • mrbiggmdmrbiggmd Members, Plex Pass Posts: 10 Plex Pass

    Interested in getting this to work for my Sports files.

    Structure

    /Sports
         /NFL
              /2013
                   NFL - 2013-10-13 - Saints Vs Patriots.mkv
                   NFL - 2013-10-20 - Broncos Vs Colts.mkv
                   NFL - 2013-10-20 - Patriots Vs Jets.mkv

    Here is my result in PLEX after the scan.

    [attachment=20812:folder.jpg]
     
    The program does not appear to enter the TV_DATE_REGEX or the TV_EPISODE_REGEX sections.  Based on naming it should enter the TV_DATE_REGEX section.
     
    I would expect the game title (after the date ex. Saints Vs Patriots) to be the title of the episode.
     
    Log file attached.  Any ideas?
     
    Thank you.
  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    There was an actually an issue with the previous code that required the name to appear exactly like it did in the original post. I have updated the plug-in to handle all of the different alternative naming conventions that Plex supports. Please update your plugin and let me know what you find.

    Just so you know the actual names of your files were:

    Sports\NCAA Football\2013\NCAA Football.2013.09.14.OSU.Vs.California.mp4

    The original plug-in was failing to match because of the periods. The original plug-in code expected the files names to use spaces and dashes for separating the different parts of the file name.

  • mrbiggmdmrbiggmd Members, Plex Pass Posts: 10 Plex Pass
    mjarends wrote on October 25 2013, 1:30 PM: »

    There was an actually an issue with the previous code that required the name to appear exactly like it did in the original post. I have updated the plug-in to handle all of the different alternative naming conventions that Plex supports. Please update your plugin and let me know what you find.

    Just so you know the actual names of your files were:

    Sports\NCAA Football\2013\NCAA Football.2013.09.14.OSU.Vs.California.mp4

    The original plug-in was failing to match because of the periods. The original plug-in code expected the files names to use spaces and dashes for separating the different parts of the file name.

    Thanks for the response.

    I updated the agent and scanned the files, and I appear to get the same result.

    The title of each video is marked as the date, not the title of the game (e.g. Saints Vs Patriots)  Log Attached.

    [attachment=20937:plex.png]
  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    After you did the update did you restart your Plex server? According to the logs you are still using the old version of the plugin.

  • mrbiggmdmrbiggmd Members, Plex Pass Posts: 10 Plex Pass
    mjarends wrote on October 27 2013, 3:14 PM: »

    After you did the update did you restart your Plex server? According to the logs you are still using the old version of the plugin.

    I shut down PLEX removed the files from the plug-in directory and then downloaded the files again from the OP and restarted PLEX and recreated the section.

    Still the same result.

    Thaks for your help.

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    Can you post the log again? Thanks.

  • mrbiggmdmrbiggmd Members, Plex Pass Posts: 10 Plex Pass
    mjarends wrote on October 27 2013, 5:33 PM: »

    Can you post the log again? Thanks.

    Attached.  Thanks.

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    The log file is showing that you still have the old version of the plugin running. Once you get the new plugin installed I'm confident it will work for you because I tested your file names.

    Can you try removing the section in Plex and stopping the server. Once the server is stopped, remove the plugin directory and then follow the instructions from the OP for installing the plugin.

  • mrbiggmdmrbiggmd Members, Plex Pass Posts: 10 Plex Pass
    I tried again following your directions and no luck. Can you tell me what prints in the log to indicate the version number?

    I compared the regex code I downloaded to your source and it appears the changes you made are reflected in the source.

    Sent from my SM-N900V using Tapatalk

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    OK I found one last issue. The regular expressions were expecting the network path to be UNC. You are using static paths. I have updated the regular expression to work in all cases. Please update the plugin and let me know how it works for you.

  • mrbiggmdmrbiggmd Members, Plex Pass Posts: 10 Plex Pass
    mjarends wrote on October 28 2013, 12:46 AM: »

    OK I found one last issue. The regular expressions were expecting the network path to be UNC. You are using static paths. I have updated the regular expression to work in all cases. Please update the plugin and let me know how it works for you.

    Awesome!!!  It worked.  Thanks.

  • MaximeMaxime Members, Plex Pass Posts: 28 Plex Pass
    edited October 2013

    Hi, I did all you said and Followed Mrbiggmd steps but I can't get any text appear on plex, only dates...

     

    Structure:

    /Home Videos
         /Allemont
              /2010
                   Allemont - 1985-08-08 - Enfance.mp4
                   Allemont - 1985-08-08 - Enfance Suite.mp4

    here is the log file:

     

    https://www.stcherbatcheff.com:5001/fbsharing/3dlGxfqu

     

    Thanks a lot for your help

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass
    xema wrote on October 28 2013, 5:18 PM: »

    Hi, I did all you said and Followed Mrbiggmd steps but I can't get any text appear on plex, only dates...

     

    Structure:

    /Home Videos
         /Allemont
              /2010
                   Allemont - 1985-08-08 - Enfance.mp4
                   Allemont - 1985-08-08 - Enfance Suite.mp4

    here is the log file:

     

    https://www.stcherbatcheff.com:5001/fbsharing/3dlGxfqu

     

    Thanks a lot for your help

    I'm unable to get the log file from the provided link. Can you please attach the log file so that I can take a look. Thanks.

  • MaximeMaxime Members, Plex Pass Posts: 28 Plex Pass

    Sorry my server doesn't seem to allow some links...

    Here:

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    Thanks for the log. There was an issue with the path separator (I had only tested on a Windows system). Please update your plug-in and refresh your metadata. Let me know if it works.

  • MaximeMaxime Members, Plex Pass Posts: 28 Plex Pass

    Thx but what do you mean by updating the plug-in, isn't the link of your first post the last version? I downloaded it today.

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    I have updated the source code that is referenced in the original post.

    To update you will need to stop your Plex server, deleted the old plugin and then follow the instructions from the original post to re-download the plugin and install it within Plex. After you restart your server you should be able to refresh the metadata for you section that uses the plugin.

  • MaximeMaxime Members, Plex Pass Posts: 28 Plex Pass

    Thanks, it's almost there.

    Here's what I get:

    For instance with the movie Allemont - 1985-08-08 - Enfance.mp4 I get "08/08 Enfance" as main title as well as the summary when I go to the edit screen. The release date is still 1985-08-08. This result is "Enfance" as expected when I uncheck the plug-in option.

    Question: If I change the file name, will it update both title and summary and replace a manual written summary?

    The expected result would be "08/08/1985 Enfance", is that how you expect it too or is the year logically wiped out because we're in the 1985 section?

    Furthermore, when I add a space for a second movie after Enfance: example: "Enfance sequel", it doesn't show the word after the space.

  • mjarendsmjarends Members, Plex Pass Posts: 170 Plex Pass

    Those are all good questions:

    1. If you are using a date based media file and you check the "Include date in title" option then name will be MM/DD Episode title from the file (for example: 08/08 Enfance). If you uncheck the option the episode title will be Enfance. I am thinking about changing the plugin to allow a user to specify a naming standard for episode titles. Let me know if this would be useful.
    2. As of right now the summary is just the episode title. I will test updating of a manual written summary and let you know. For my personal needs I don't ever specify a summary. I had thought about enhancing the plugin to look for a filename-summary.txt file in the same direct as the media file to use in loading the summary in Plex. Let me know if this would be useful.
    3. You should be able to add spaces, periods, etc after Enfance. My files are all multi-word titles and I haven't had any issues. Maybe you could provide me the exact file name for testing purposes.
«13456714
Sign In or Register to comment.