Closed EndOfLine369 closed 8 years ago
Wow, that is a descriptive feedback, nice to see after a bunch of reports where people didn't select my scanner or installed my agent wrong and flooded the forums... Why closing the issue already though ? Enhancement 1 to 3 definitely. The path list need to be as complete as possible. i wish i could just piggy back easily into Plex logs folder but that is all i could hack to re-use the folder
Fix 1: If somebody force a tvdbid in folder name or in a tvdb.id file in series folder or Extras folder inside it, it build a mapping list (abs ep number => (season, ep)) to make the absolute series show up with seasons, and is converted just before adding the files. If serie is split in seasons, it is in tvdb mode and i think i didn't account for season folders and tvdb,id forced. maybe i should put tvdbabs-xxxxxx to take tvdbid and let know there is a need for mapping or not. you fix isn't bad in that regards but better not mapping if not needed
Write Fixes 2 (listed twice number 1) didn't know i had this bug so definitely...
Thanks for really useable fixes Looking at https://github.com/ZeroQI/Hama.bundle/issues/25 now
Looks like you committed all my changes =) Nice :+1: No code is perfect and i'm all for assisting in code dives. Hope the gist code info made it easier for you as well for seeing the diffs. And yeah, by looking for a specific 'absolute_numbering.list' file, it will only pull mapping info with URL queries when clearly requested and not every time a tvdbid is pulled from a tvdb.id file which could be taxing depending on people's setup.
I have to rewrite the tvdb seasons used for absolute series: . Anidb-xxxxx for absolute series . Tvdb-xxxxx for season series . Tvdb2-xxxxx for abs series displayed as season folders This will enable tvdb season conversion mode and load the mapping file on the given tvdbid. I see no need to load scudlee's xml for now. I will put a variable anidb_tvdb_conv to True and convert tvdb2-xxxxx to tvdb-xxxxx to reduce complexity...
Are you talking about the optional files 'tvdb.id' and [tvdb-xxx] in the folder names getting these additional options? That would still not resolve the need to not load scudlee's xml. The only point it will ever need to load the xml to get the tvdb id for the tvdb api call when the anidb # is used. If the tvdb id is present, it dosn't even bother with the xml anyway and just directly goes to the tvdb api.
It is the anidb->tvdbid conversion requiring scudlee's xml that is not being solved with this proposal. The only thing this would replace is the need for an 'absolute_numbering.list' file in replace for using 'Anidb-xxxxx' or 'Tvdb2-xxxxx' in the folder name or a separate id file.
I am sorry but i don't understand what you mean. Double negative didn't help... I do not see the need to use the anidbid if using tvdb seasons on absolute numbering. My implementation could allow hybrid numbering too (tvdb3-xxxx) with seasons but eps keeps the absolute numbering...
I think I get you now. You basically want to require people to specify the tvdbid if they want to use the abs->season ability. Thus bypassing the need to poll scudlee's xml with these two options.
(1) use 'tvdb2-xxx' if they have episodes in abs numbers but want it added into plex as seasons and numbers reset to ep 1 on season change.
EX (for a 3ep first season):
files: 1 / 2 / 3 / 4 / 5 => plex: s1e1 / s1e2 / s1s3 / s2s1 / s1e2
metadata.id = 'tvbd2-xxxx'
(2) use 'tvdb3-xxx' if they have episodes in abs numbers but want it added into plex as seasons and numbers NOT reset to 1
EX (for a 3ep first season):
files: 1 / 2 / 3 / 4 / 5 => plex: s1e1 / s1e2 / s1s3 / s2s4 / s1e5
metadata.id = 'tvbd3-xxxx'
These ids can also then be added into the new numbering if statement section for tvdb_table i proposed in the Hama issue ticket. Correct?
Yes. I detect automatically seasons but when forcing conversion modes to displaysomething different from what is on disk, the above would be the most simple.
I am unsure i can code easily the mode 3 which is seasons but absolute numbering for episodes, nor if i should encourage people not wanting to follow the naming convention of anidb or tvdb but i see the attractiom of that hybrid mode due to the un-ease of 100+ eps in plex and the simplicity of the abs numbering. Will code it when am vack from japan or if i have time before
please test https://gist.github.com/ZeroQI/26d26f91af04c876b1a0 Cannot test myself, my plex server is not accessible since i updated it until i come back to ireland
Here is what I have at the moment https://gist.github.com/EndOfLine369/20159a2480502f0839fc Still testing.
But just to comment on your code:
Made a corresponding update to the Hama init file to handle the addition of tvdb2/3 https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc I'm not seeing any issues myself in the above scanner code. And with this hama code, it is populating the metadata correctly.
Just jumping in to comment and see if this proposed fix will handle the Absolute Numbering / Season issue I've been having.
With a lot of the long-running anime shows I have (example: Detective Conan, One Piece, even Dragon ball Super) I've had issues with no metadata appearing. I have all of these shows with Absolute Numbering, but I've split them into different season folders on my harddrive. With shows like DC and OP, having 700+ episodes in one folder is a little overwhelming. I've split up the "season" folders in accordance to TVDB's definition of each shows season. What I don't do is rename the shows to the "S04E01" format, as I'd like to keep the absolute numbering that is commonly associated with anime.
Despite doing this, I do not tend to get any metadata, titles, etc... after the first season. This stays true whether I use Hama or TVDB as my Agent.
Will these proposed fixes move towards fixing this issue?
Hi @sven-7, that is correct. If you want to test my updates to the scanner & hama as well, feel free :smile: . As it is always good to have more testers than just ZeroQI and myself. Make sure to take a backup of your existing code so if you see issues so you can revert to your prev working code.
"Absolute Series Scanner.py" https://gist.github.com/EndOfLine369/20159a2480502f0839fc "init.py" https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc
Update your files and then in your folders where you want it to interpret the absolute numbering, either put in the series' folder name one of the below "[tvdb2-xxx]"/"[tvdb3-xxx]" or the id in a corresponding "tvdb2.id"/"tvdb3.id" file with the tvdb number in it.
(1) use 'tvdb2-xxx' if you have episodes in abs numbers but want it added into plex as seasons and numbers reset to ep 1 on season change.
EX (for a 3ep first season):
files: 1 / 2 / 3 / 4 / 5 => plex: s1e1 / s1e2 / s1s3 / s2s1 / s1e2
(2) use 'tvdb3-xxx' if they have episodes in abs numbers but want it added into plex as seasons and numbers NOT reset to 1
EX (for a 3ep first season):
files: 1 / 2 / 3 / 4 / 5 => plex: s1e1 / s1e2 / s1s3 / s2s4 / s1e5
Thanks, @EndOfLine369.
I've applied the Scanner and Agent updates and have started testing with a few different series.
Question on the TVDB corresponding ids. Where I'm using the latter example, do you want the "tvdb3-xxx" to have the Series ID or Season ID? Does an ID file have to be placed within the top-level series folder or one in each of the corresponding season folders?
Example 1: Dragon Ball Super TVDB Series ID: 295068
Example 2: Dragon Ball Super TVDB Season 2 ID: 644129
Another question -- is it best practice to have the seasons split into folders manually or let the scanner/agent determine the seasons by what TVDB has defined them as? Currently, again using Dragon Ball Super as an example, I have the 36 or so episode files split into the three season folders as defined by TVDB.
I'll continue to test this later today with additional an additional series.
It would be the series id only and just in the top level folder.
EX:
"Dragon Ball Super [tvdb3-295068]" / "Season 1" / <episode_files>
or
"Dragon Ball Super [tvdb3-295068]" / <episode_files>
If the folders under the main series folder are not a specific naming format, they are ignored so leave the sub folders as "Season
season_rx = [ ### Seasons Folders
'Specials', # Specials (season 0)
'(Season|Series|Book|Saison|Livre|S)[ _\-]*(?P<season>[0-9]{1,2}).*', # Season ##, Series #Book ## Saison ##, Livre ##, S##, S ##
'(?P<season>[0-9]{1,2})a? Stagione.*', # ##a Stagione
'(([Ss]tory )?[Aa]r[kc]|[Vv]ideo).*' ] # Last entry in array, folder name droped but files kept: Story, Arc, Ark, Video
It should not matter if the episode files are all in the top series folder or split into child season folders. As i can add in a ( "Season 1" / "EP451" ) file but the scanner still put it in as season 21 in Plex. This is because by using the 'tvdb2'/'tvdb3' options are telling the scanner to ignore any found or not found season info via folders and override it with the season# defined in TVDB for that absolute episode #.
Okay, that's what I assumed. Thanks. I've attempted this a few different ways, but typically having no success.
Just to make sure there is no confusion on the setup, as you mentioned you were trying different agents. Can you please make sure that your using Hama agent and ASS scanner on the library your testing this out on as this sounds like the TVDB agent and plex scanner.
The location of the files above should have been:
Plug-ins/Hama.bundle/Contents/Code/__init__.py
Scanners/Series/Absolute Series Scanner.py
Can you please provide your log files:
Logs/Plex Media Scanner (custom ASS).log
Logs/PMS Plugin Logs/com.plexapp.agents.hama.log
Yep -- I placed your versions in both locations (and did so again today to be sure).
Here are the logs....
Looks like your scanner is not updated as I don't see these entries in your scanner log on "TVDB season mode".
EX:
2016-03-30 21:59:21 Scanner call - root: '/share/TV Shows', path: 'Red vs Blue [tvdb3-78896]', dirs: '3', files: '112'
2016-03-30 21:59:21 =============================================================================================================================================================
2016-03-30 21:59:21 folder_show = 'Red vs Blue [tvdb3-78896]'
2016-03-30 21:59:21 tvdb id = '78896'
2016-03-30 21:59:21 TVDB season mode (3) enabled, serie url: 'http://thetvdb.com/api/A27AD9BE0DA63333/series/78896/all/en.xml'
2016-03-30 21:59:22 "Red vs Blue [tvdb3-78896]" s0001e001 "RvB_EP01_HiRes.mov" "HiRes"
Also your Hama is seeing issues as well. Probably as folders under the "DataItems" were not created for the metadata agent?
IOError: [Errno 2] No such file or directory: u'\\\\?\\C:\\Users\\Sven\\AppData\\Local\\Plex Media Server\\Plug-in Support\\Data\\com.plexapp.agents.hama\\DataItems\\TMDB\\._tt1528406-art.jpg'
The output from the agent logs also show an issue in your naming.
2016-03-31 15:21:54,825 (330) : INFO (logkit:16) - File: 's3e32' 'A:\Anime Series\Dragon Ball Super [tvdb3-295068]\Season 03 [tvdb3-650773]\Dragon Ball Super - 32 - The Matches Begin! Everybody Heads to the Nameless Planet!.mkv'
should be A:\Anime Series\Dragon Ball Super [tvdb3-295068]\Season 03\
The scanner not being updated could have some knock on effects of the hama agent. There is also one instance I am see that should have been loaded right in log.2 where it was loading right but then was reloaded as single anidb season with some dual searches for 'Dragon Ball Super' & 'Get Backers' at the same time. Could be you were trying to do things in multiple browser tabs and they were overlapping eachother? Could also be causing your above IO issue.
I'll try replacing the scanner once more.
Suggestions on the Scanner not updating? I've replaced the old one several times. I'll try once more now.
Looking at the Hama Guide -- it doesn't call for the creation of "TMDB" does it? Only TVDB, I thought. Here is what the current file structure looks like....
Yes, the latter you're right. That was a test on my part (prior to your response earlier) about using Season IDs.
I had a separate test library going where DB Super and Get Backers were loaded. I've since deleted that, but it's possible it was called on accident in a separate browser window.
On the scanner, remove the '.pyc' file Scanners/Series/Absolute Series Scanner.pyc
(compiled python file). It could be your python install is not recognizing it needs to recompile the scanner file. Any more than this, and it still does not work for you, I think we will need to wait for ZeroQI to get back from Japan to test as well.
Oddly enough...there is no .pyc in the Series folder. There is one for the Scanner in the Movies folder (and it created a new one after I replaced that ASS as well). This could be the issue?
Here is what both files look like after I replaced the Scanner and started Plex back up.
On second thought...I might need to entirely remove the Scanner from the Movies section. That could be the issue here. (I don't compile Anime Movies and Series in the Plex series-style library) -- I also decided to use the Plex movie scanner for that, so this is now irrelevant being here anyway.
Okay -- after some work, the new scanner seems to be up and running. I cleared out the logs and here is what's happening:
You'll see Log Horizon and Detective Conan are being...disagreeable. That seems to be due to having child season folders. Upon first scan, Dragon Ball Super did the same thing. When I put them all into one directory, tvdb3 mode activated and separated them.
So once you made folder changes after you corrected the scanner file it did it correctly? That is probably due to Plex behavior I don't exactly understand. If a scan is performed on a library but a folder has not been touched, it will probably be skipped over in a scan (but not always). Once you moved files around in the folder (could also change the folder name) it saw a change and scanned the files and put them in as separated seasons.
Yep - exactly. Once I took (back to DB Super) the three seasons and combined them all under the parent DB Super folder (tvdb3), Plex split them up into three seasons on its own.
Definitely seems consistent. I'm doing it one-by-one and where I have a parent folder labeled, but seasons within it, it'll skip and move on. Once I change it, it'll import correctly and is grabbing the right metadata from TVDB as well. (I've confirmed this since I did it for a show I did updates on myself today)
I've tested a tvdb2 as well and that seems to be working (aside from the occasional Plex driven hiccup).
Thanks for all your help, by the way.
More or less been having success with the series scanning in correctly. I'm only getting partial metadata it seems. I.e. I am getting episode descriptions, but no directors, writers, producers, etc.. are coming through. This is probably related to Hama, correct?
Jumping in a little late, but I'm seeing the same things as @sven-7. I've been using tvdb3 mostly and had success with the absolute numbers staying and episodes being split into seasons. Also the descriptions are showing up.
The issue is the directors, writers, etc don't show up. The tvdb api calls seem correct and the xml coming back has everything in it, but it gets dropped somewhere along the way. I'll post some logs later tonight.
Looking great so far though, thanks!
Looks like it is not a bug but an enhancement. In the TVDB section in Hama, it does not pull that info to insert into Plex.
Looks like the mapping update to handle tvdb2/3 broke summary info for 'anidb-' series. As even though it pulls in anidb info, but it still relies on tvdb for episode summaries. Will see what I can do to fix.
Update: To clarify, 'anidb-xxx' series where files are not split into seasons and are all abs numbering in a single folder. If 'anidb-xxx' is used but files are split into multiple seasons, it will not be an issue as Hama no longer sees those as anidb and parses them in TVDB seasons mode.
Updated "init.py" - https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc
Has these in it from prev:
After the latest version/fix, the info seems to be pulling in correctly now. Nice!
Thanks for that, EndOfLine369.
i was away for 2 weeks in japan and my plex server became inaccessible after a remote update... I just came back to ireland (am french by the way), all i could do was amend the scanner but left quite few issues, i apologise...]. I can follow more activelly now
i know you fixed it in the end on both scanner and agent. i was mitigated on the use of the hybrid mode but had been thinking about it for a while.... You left the tvdb2 in the guid which i didn't want to do, but there was to me no way to make the agent work 100% with the default tvdb-xxxxxx guid... That was the only easy way...
You seem pretty prolific EndOfLine369 so If you want explanations on some parts of the code let me know.
You do seem to know your way around the code though... That was my first project with Hama and i code the shortest i can, but it may appear a bit hectic to people with proper coding formation...
Do you want to do a proper fork ? i applied the changes in the meantime on both scanner and agent and credited you...
If you have other improvement suggestions, let me know
Hi @ZeroQI, welcome back!
Before any commits, I just wanted to give one last update. I've put this to a full test with most cases in my library that would require usage of tvdb2 or tvdb3 -- and I'm using both on a case-by-case basis.
For example, I'm using tvdb3 for many of the long, continuous series like One Piece, Detective Conan, etc...
I've found that tvdb2 is great for other shows that are multiple cour, but not necessarily continuous like the ones above are. Some examples here are: Sword Art Online, Log Horizon, Ace of Diamond. This gives the nice ability to have the shows cleanly wrapped up into one series versus having multiple series for Sword Art Online and Sword Art Online II.
@EndOfLine369 -- have you had any experience in your testing with specials? I have all 700+ episodes of One Piece getting pulled in !00% perfectly now (which I have yet to see successfully before now), but I decided to add some specials as well and it's not taking it very well.
I have all episodes of One Piece absolute numbered, but the specials don't exactly have that. I went with the "One Piece - S0EXX" or "One Piece - 0xXX" format, but they're not mapping. Not a big deal, by all means, but just wanted to let you know.
Overall, the only major issue I've seen was with Lupin III. Currently, TVDB doesn't have them all absolute numbered, which in turn kind of breaks the series up in a weird way. I ended up leaving it as separate series and syncing the standard way with AniDB. Though...Plex continually tries to combine them into one. I manually matched them all with their respective AniDB ID.
Happy to provide any logs or anything you might need. While I don't know my way around code, I'm more than happy to be a tester for this. Great work everyone!
create an account on tvdb and edit/complete the absolute numbering? does the specials work in anidb and tvdb mode? Or is it only tvdb2 and tvdb3 impacted ? Can i have an exemple of an episode number and filename ? is the special mapped through ScumLee's XML mapping files ?
Unfortunately, the series are locked. Renumbering is being discussed in the forums, and it should happen eventually, but it's just something that has to be worked around for now I think.
So, looking at this -- it might only be the tvdb3 that causes problems here. For One Piece, I have it set to tvdb3. It pulls in all 734 episodes and separates them out into seasons, with metadata, just fine. It's the Specials that are getting caught up. My thought it because it doesn't know what to do with them as they have no absolute numbering? An example is S0E33 - Adventure in Nebulanda (http://thetvdb.com/?tab=episode&seriesid=81797&seasonid=31892&id=5487690&lid=7). In AniDB, it's defined as Special 22.
In two series that I have mapped to tvdb2, the specials seem to be fine. Perhaps that is because tvdb 2 allows a renumbering of episodes in each season? Wagnaria!! (http://thetvdb.com/?tab=season&seriesid=145211&seasonid=201131&lid=7) all shows up fine, all three seasons and the special. The same with The World God Only Knows (http://thetvdb.com/?tab=season&seriesid=195711&seasonid=330571&lid=7). Both series and their specials are populating/mapping the metadata correctly.
I've also tried both naming conventions for the episode (TVDB - S0E33 and AniDB - S0E22).
Here are my logs:
I am able to replicate. I have put these episodes under tvdb3 & tvdb2:
[HorribleSubs] One Piece S00E19 - 3D2Y - 01 [480p].mkv
[HorribleSubs] One Piece SP21 - Episode of Sabo - 01 [480p].mkv
Updated "init.py" - https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc
@ZeroQI if your ok with the last fix from this thread, I think we can close this ticket out. Any further issues can be raised in new issues tickets.
I've also only been on GitHub a little over a month for your awesome Plex code that you've spent a long time on. I don't exactly know how to use this site yet and only found Gist a fortnight ago. So i'm all for keeping all updates in the main base you own and not a fork to allow everyone to benefit. As well as helping you out if wanted :smile:. If you want me to provide Gist links or Forks for you to pull in if I help out in the future, just let me know.
@EndOfLine369 success here as well. Had to name the specials with TVDB's numbering since they don't match up, but it's all pulling down successfully. Thanks!
@ZeroQI : Noticed that directors/writers/producers were getting added in multiple times.
Updated "init.py" - https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc Since your last commit of my updates to the master, now contains:
I'm also having trouble with Hellsing Ultimate's specials pulling in (and two episodes disappear). It looks like the scanner is registering them, but they disappear along the way.
I mirrored your file names and tested. I found there was a minor type issue on a test that was causing mapping to be wrong for metadata to be seen. please re-pull my "init.py" and retest.
On items disappearing, I don't see that happening as once the scanner sets the season and episode number it is fixed. The only thing that could make it disappear is it gets associated with a different show. But even then, you should be able to find it potentially as a duplicate episode.
Yes - you're right. Something was happening with Hama. Looking at the logs, it wasn't loading the plug-in code.
Anyway -- Looks like it's importing correctly now (I had to set it to tvdb2), with metadata. Where episodes 6/7 were doubling up earlier with 8/9, it seems to be fully importing.
OK closing, reopen this or new one if needed, thanks a lot EndOfLine369, you made it possible, and thinking back, this is the only agent supporting that and that is cool :D
In response to my other issue ticket "https://github.com/ZeroQI/Hama.bundle/issues/24"
https://gist.github.com/EndOfLine369/20159a2480502f0839fc/revisions Linked file is based off of a 2016-03-21 pull.
If you agree on my changes, i'll create a fork for the changes so you can just pull into the master.
Here is my list of enhancements:
'@Recycle', '.@__thumb'
"(Clean)"
'/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Library/Plex Media Server/Logs', # QNAP
Here is my list of fixes: