Hi mjarends,
Any luck with my log?
Hi mjarends,
Any luck with my log?
@mrkaymrkay Sorry I didn’t get an email when you posted the log. I looked through the log and it doesn’t contain a lot of information. Are you having an issue with the InDesign shows that are showing in the log or are you also having an issue with the ‘01 Swift & Obj C’ show?
You may need to manually run the Plex scanner on the library that you are having an issue with using the command line documented on this page: https://support.plex.tv/hc/en-us/articles/201242707-Plex-Media-Scanner-via-Command-Line.
Use the steps under the ‘Scan & Refresh a Library’ section to run the scanner on the section that is having an issue. Make sure you add the –verbose option when run the command.
Thanks for the answer!
The one that doesn’t get added is called Swift Tutorial (folder named Tuto swift).
I will try the command line but I’m not sure it’ll be easy since Plex server tuns on a NAS
@mrkaymrkay Is there any chance you could post the exact paths that are not working and are resulting in the single show. I want to verify that the plugins are parsing the names incorrectly which could result in them seeing the files as a single show.
@mjarends, in this case the show is not added at all.
The other issue of multiple shows merged as one was my mistake, I was having different shows in a single folder so they were considered as a single one.
Thanks again for your help
@mrkaymrkay Could you post the exact paths that are not getting added. It would help troubleshot the issue.
Here it is,
Everything that’s inside this directory is not added :
/Volume1/video/Tutoriels/Informatique/Tuto\ Swift
Files are named like : Swift Tuto - S01E01 - Welcome.mp4
HTH
@mrkaymrkay If the “” character is part of the folder name then it would cause issues. The regexes that are used in the scanner/metadata agent would see this as a path divider instead of just part of the folder name which would cause the folder to be ignored.
I would suggest either removing it or changing it to a character other than “”.
@mjarends the "\ " is just the escape char for the space. I pasted the link from a bash terminal. The name is “Tuto Swift” with a single space in between
For some sports, the season starts in one year and ends the following year. I’ve hacked up the script to force those later episodes into the previous season.
dayOfYear = str(self.episodeReleaseDate.timetuple().tm_yday + 365*(self.episodeYear - self.seasonNumber))
Please consider officially supporting something like this.
@trevor.cortez Supporting sports would require an external configuration file so that a user could configure the start month/day for each individual sport. For example if I was storing all of my NFL games in a top-level NFL folder I would want to configure the start of season to be 9/1. I will put in on my “Todo” list but no promises on when I would get to it.
Currently you can include episodes that are in different years in the same season by following season/episode - date pattern below:
/My Shows/NFL/NFL - s2015e01 - 2015-12-31 - Minnesota vs Green Bay.mp4
/My Shows/NFL/NFL - s2015e02 - 2016-01-07 - Minnesota vs Chicago.mp4
Both of the shows above would show up in the 2015 season and would additionally have the correct “Originally Available” date.
First off, great work on getting this plugin/Agent done… I’m trying to make use of it for training for both work and personal video’s…
The issue I’ve run into is many of the training video’s even though I’ve renamed them all all have a “SxExx - Original File Name.avi” as an example the scanner currently seems to get confused if a date is included in the name as well as with sub folders…
For example some of my work training video’s have the following structure:
\Learn the Basics
\Day1
S1E01 - Lets get started.avi
S1E02 - Day 1 warp up.avi
\Day2
S2E01 - Welcome to day 2.avi
S2E02 - Home Time.avi
\Software ABC
S1E01 - ABC.avi
S1E02 - DEF.avi
S1E03 - HIJ.avi
S1E04 - Webinar-2015-03-27-Updated content.avi
In the example above the first issue I’ve run into is with sub folders… I have allot of content that is based on sub folders which the basic Plex agent seems to have worked fantastically with in that it always seemed to use the top folder as the Show name “Learn the Basics”… The extended personal media scanner seems to create shows named “Day1”, “Day2”…etc… which unfortunately breaks things for me. Is there any way to get it to always use to top most folder as the show name always and then any files below as part of that 'show"?
Second issue I have is with the second example of “Software ABC” the first 3 episodes in the example above all work 100% well however the 4th episode creates it’s own show called “S1E04 Webinar” and has a single episode “8601” called “Updated contend”… This show should rather be located under “Software ABC” and also have an episode title as “Webinar-2015-03-27-Updated content” as it has a Season and Episode listed the date used in the episodes name should perhaps be ignored when working out the season and episode details?
Thanks very much once again for you assistance with this 
@Jon_C First off wanted to check that you are using both the Extended Personal Media Scanner and the Extended Personal Media Agent. See the first post for a link to the latter. If both plugins are not used together you will get very inconsistent results.
In your first example above (Learn the Basics) the scanner + agent are going to recognize the SxxExx pattern and because the folder immediately above does not follow the season/chapter naming pattern would treat the Day1, Day2, etc. folder as the show title. In order to get this to display the correct way within Plex you would need to remove your Day1, Day2, etc. folders or change them to be Season1, Season2, etc.
In your second example (Software ABC) the pattern supported by the plug-in for date based shows is - SxxExx - YYYY-MM-DD - .. In your case the agent recognized the last show as following the SxxExx - Date pattern and parsed “S1E04 - Webinar” as the Show Name. If you want this episode to appear under the “Software ABC” show in Plex then the name would need to be changed to “S1E04 - 2015-03-27 - Webinar-Updated content.avi”. Another way would be to change the “-” in the date to a “+”. The “+” character will not be recognized as part of the date string and the scanner/agent will treat it as the episode title instead.
Hopefully this helps you get this implemented.
Hi mjarends
Thanks very much for the reply, sorry I forgot to mention I have got both installed and selected on a new library I’m trying to get these personal training video’s working with…
Some of the content in the Day1, Day2 folders I unfortunately can’t move things around too much as it’s got reference materiel in some other applications and renaming some of the movies has caused some issues which I’ve worked around…
Would you happen to know if there is an easy way to basically use the default Plex scanners/Agents but just enable it to use what ever name is after the SxxExx part as the episode name as everything else seems to work 100% well for the video’s I have except I need it to index the file names and I’m not sure if this is something easy to do (Eg, is it easy to take the default Plex Agent and alter it slightly to add that one extra bit of metadata during scanning as all other logic seems to be 100% fine for me…)
I Understand this request might not be your speciality as it’s not related to this addon but though I would be worth asking the question in case you know of any other possible/easy work around… or you could recommend or point me in the right direction on how I could possibly achieve this with little programming knowledge myself perhaps (eg, try and duplicate the internal Plex agent, give it a new name and get the agent to do every thing the same but just include an episode title with what ever is after SxxExx?
Thanks very much!
@Jon_C Sorry I can’t tell you how to modify Plex’s scanner and metadata agents. You could modify my plugins if you wanted so that they treat the DayX folder like a season folder. In order to do it you would need to add to or modify the existing regular expressions in the Scanner and Metadata Agent.
To modify the Scanner you would need to add the regex to the SeriesEpisodeMediaParser.getSupportedRegexes(self) method in https://bitbucket.org/mjarends/plex-scanners/src/d068c921138a0d05885e92e32fc5c3a8b31a8d41/Series/Extended%20Personal%20Media%20Scanner.py?at=master
To modify the Metadata Agent you would need to add the regex to the SeriesEpisodeMediaParser.getSupportedRegexes(self) method in https://bitbucket.org/mjarends/extendedpersonalmedia-agent.bundle/src/89a9c9cceb073ac832b5e4c34393abae8b203b56/Contents/Code/init.py?at=master
Thanks very much for your help mjarends, much appreciated… I’m trying to wrap my head around the code and how to do the changes but it’s currently a little beyond me unfortunately…
I’ve also had a look into the default Plex .Py scripts and also no idea so I might just need to find another solution unless you can recommend someone that could perhaps assist a little further even if it involves a small price to get it done.
I’ll also try and see if I can get Plex team to perhaps consider adding the episode title into the default Agent as if no online metadate is found to me it makes sense to then use the episode title in the file if it exists… (not sure I will have much luck though as it seems many have been asking for this for some time already)
Hi Again mjarends
Sorry to bother you but would you happen to know how I can add some of the following to the SeriesEpisodeMediaParser part (I’m trying to understand how I can enter code to essentially ignore sub folders and always use the root at the show title and any Season or Episode files found below will always belong to that show title/top level folder…
I’ve also found none of my shows at the Show Title in the files so I was also wanting to remove this from being required at the file level but only really needed at the top folder level as per the following I believe:
Show Title\S#E## - Episode Title.mp4
Show Title\FOLDER?\S#E## - Episode Title.mp4
Show Title\FOLDER?\FOLDER?\S#E## - Episode Title.mp4
I’m not sure if another method is needed to scan/ignore folders for what I’m trying to do as I see the default Plex media scanner Py file is written differently and I was hoping to steal some code to mix in with yours to get something that works for me but looks like it’s not possible (or I should rather say, not easy)?
…Plex Media Server\Resources\Plug-ins-24ffd60\LocalMedia.bundle\Contents\Code_init_.py
Thanks again 
@Jon_C I would recommend only modifying the regexes in the code. Modifying/tailoring these should accomplish what you want. The other thing that is very important is that your regular expression still needs to be place the extracted values in the variables (i.e. <showTitle>) below in order for the rest of the plug-in to work:
r'[\\/](?P<showTitle>[^\\/]+?)[ ]*[-\.]{0,1}[ ]*[sc](?P<seasonNumber>[0-9]+)[e](?P<episodeNumber>[0-9]+)[ ]*[-\.]{0,1}[ ]*(?P<episodeTitle>.*)\.(?P<ext>.+)$'
I would start by modifying the regular expression above and test against your folder paths using pythex.org. Once you have achieved your result then add it as the first regular expression in the array in the method I referenced above.
Thanks mjarends
I’m having a play around and I’ve managed to get the first custom codes done but struggling with the ‘skipping’ sub folders… would you happen to know how/if this can be done?
(WORKING!) - #s1e09 - Episode Title.mp4
[sc](?P<seasonNumber>[0-9]+)[e](?P<episodeNumber>[0-9]+)[ ]*[-\.]{0,1}[ ]*(?P<episodeTitle>.*)\.(?P<ext>.+)
(WORKING!) - #\Show Title\s1e09 - Episode Title.mp4
(?P<showTitle>[^\\/]+)[\\/][sc](?P<seasonNumber>[0-9]+)[e](?P<episodeNumber>[0-9]+)[ ]*[-\.]{0,1}[ ]*(?P<episodeTitle>.*)\.(?P<ext>.+)
(IN PROGRESS…) - #\Show Title\SUBFOLDER\s1e09 - Episode Title.mp4
(?P<showTitle>[^\\/]+)[\\/][sc](?P<seasonNumber>[0-9]+)[e](?P<episodeNumber>[0-9]+)[ ]*[-\.]{0,1}[ ]*(?P<episodeTitle>.*)\.(?P<ext>.+)
@Jon_C Assuming your folder structure above with “DayX” then try the following:
(?P<showTitle>[^\\/]+)[\\/]Day[0-9][\\/][sc](?P<seasonNumber>[0-9]+)[e](?P<episodeNumber>[0-9]+)[ ]*[-\.]{0,1}[ ]*(?P<episodeTitle>.*)\.(?P<ext>.+)