ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
999 stars 155 forks source link

[Enhancement] TVDBID season/ep man offset & ANIDB2 auto offset #46

Closed saitoh183 closed 8 years ago

saitoh183 commented 8 years ago

im experimenting with the TVDB 2,3 settings on my test library and i was wondering if it would be possible to use the season id instead of just the tvdb id for people that have each season as there own show and dont want to group them.

I use Japanese Media Manager for renaming and moving my anime to its final location. It uses anidb as source and uses hash info from file to determine what the show is and where it goes. So this means that shows like SOA/Fate stay night..etc are all in there own folder for each part of the series. Movies are also in there own folder since anidb treats every movie as its own show.

seeing this new way of adding content with the different profiles is a big thing since it doesn't necessitate movie around folder structure (in certain cases) or renaming files to fit tvdb.

Example: here i some test data http://pastebin.com/sqQAG96t

My Bakuman is each in its own folder...since tvdb also has season ids, could you do something like Bakuman [tvdb-193811_326091] [tvdb-ShowID_SeasonID]. This would tell scanner that this is season 1 ...Bakuman. (2011) [tvdb-193811_473098] equals season 2 and so on..this could be a tvdb5 :) Of course i dont know what this type of request requires in code change but i thought i would shoot the idea.

saitoh183 commented 8 years ago

@sven-7

How is your black lagoon setup (filelist) cuz even with tvdb4 i get everything under the first 12 eps...

http://pastebin.com/MZgQezHQ

ZeroQI commented 8 years ago

Guys, it's simple tvdb4 keep the absolute number and allow to put in any season but doesn't map seasons so working as designed. use anidb2 mode to assign ep to right anidbid, and will be mapped automatically to the right tvdb id

EndOfLine369 commented 8 years ago

The core problem here is that saitoh183 just dosn't understand how to use the modes (no offence). Will need to try and put a readme/how-to on the modes.

saitoh183 commented 8 years ago

@EndOfLine369

None taken....from the read me it is so so clear when to use what depending on what your initial file setup is.

EndOfLine369 commented 8 years ago

:grin: Bright side is from when you used the offset moves for tvdb* modes ('-s2]'/'-s3]') is it worked for your setup. The main problem now is to make it clearer on how to use the new 'anidb2' and 'tvdb*' offsets.

saitoh183 commented 8 years ago

yes...cuz anidb2 works well for black lagoon but if i use it for bakuman, would i get the same result as tvdb*-s2/s3?

EndOfLine369 commented 8 years ago

On your above tvdb4, what you got is exactly what I would expect. Your keeping a single series in separate folders. If you want to use tvdb4 mode in that separate folder setup, you will have to use the season tvdb offset setup.

https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/tvdb4.mapping.xml

  <anime tvdbid="79604" name="Black Lagoon">
    01|001|012|The First Barrage
    02|013|024|The Second Barrage
    03|025|029|Roberta's Blood Trail
  </anime>

Without an offset defined, they will each be seen as starting at s1e1. Correct your folder names with the below offset additions.

FROM:
'D:\Videos\Animehama', path: 'Black Lagoon [tvdb4-79604]'
'D:\Videos\Animehama', path: 'Black Lagoon - The Second Barrage [tvdb4-79604]'
'D:\Videos\Animehama', path: 'Black Lagoon - Roberta`s Blood Trail [tvdb4-79604]'

TO:
'D:\Videos\Animehama', path: 'Black Lagoon [tvdb4-79604]'
'D:\Videos\Animehama', path: 'Black Lagoon - The Second Barrage [tvdb4-79604-s2]'
'D:\Videos\Animehama', path: 'Black Lagoon - Roberta`s Blood Trail [tvdb4-79604-s3]'
saitoh183 commented 8 years ago

But if black lagoon is a single season on tvdb, why would you add s2 and s3 if they dont exist?

EndOfLine369 commented 8 years ago

Correct, 'anidb2' is the same as defining the tvdb offsets. BUT, if you don't use the same mode for all of a series' separate folders you might run into issues.

EndOfLine369 commented 8 years ago

Your missing the point of 'tvdb4'. 'tvdb4' uses our own defined season definitions as shown in the above xml. Not TheTVDB's definition.

saitoh183 commented 8 years ago

Ah...i get it...then i would suggest a rename of tvdb4 to something that relates to custom. using tvdb4 can confuse people in to thinking that tvdb is related in some way

EndOfLine369 commented 8 years ago

That fact is already stated in the readme. And will not be changed from 'tvdb4' as the id number required is a TVDB site series number. https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/README.md

guid_type Seasons numbering Episodes numbering Use case (example)
tvdb2 TVDB Season Multiple single season series (Sword Art online)
tvdb3 TVDB Absolute Long series (Detective Conan)
tvdb4 Custom/Arc database Absolute Long series with arc (one piece, dragon ball)
saitoh183 commented 8 years ago

yeah...i get it... :) i think in my case given the way anime is setup, anidb2/tvdb-XXXXX-sX will be what i use most of the time. Using it on bleach seems to fix the movie problem i stated above

saitoh183 commented 8 years ago

I used tvdb3 for bleach and it worked well (get everything in season format) but anidb2 with the movies gives the proper result for specials but since anidb2 and tvdb3 dont mix, i will get 2 separate shows. Im guessing i should the use plex merge to put them together?

EndOfLine369 commented 8 years ago

No, you will potentialy have issues in metadata being loaded correctly as 'anidb2' says episode numbers are reset to 1 at each season while 'tvdb3' says they don't reset to 1. You will have to use the tvdb offset for the movie folders to work with a 'tvdb3'. Ex:

"Bleach [tvdb43-74796]"
"Bleach movie 1 Memories in the Rain [tvdb3-74796-s0e3]"
"Bleach movie 2 The Diamond Dust Rebellion [tvdb3-74796-s0e4]"
"Bleach movie 3 Fade to Black [tvdb3-74796-s0e5]"
"Bleach movie 4 Hell Chapter [tvdb3-74796-s0e6]"
saitoh183 commented 8 years ago

ah didnt know you could use the eps number as well with the season within the brakets

saitoh183 commented 8 years ago

humm...didnt work for movies

http://pastebin.com/MVes4zDp

EndOfLine369 commented 8 years ago

Looks like it might be crashing as I see no entries saying files are being added into Plex. Please provide the "Plex Media Scanner.log" log.

EX: 2016-03-21 05:43:37 "Naruto Shippuuden -s10 -a4880 -n7293 [tvdb-79824]" s0021e003 "[HorribleSubs] Naruto Shippuuden - 453 [480p].mkv"

saitoh183 commented 8 years ago

http://pastebin.com/ny48vhdi

EndOfLine369 commented 8 years ago

Bingo. Will take a look.

Jul 25, 2016 00:18:58.386 [8168] ERROR - Error in Python: Running scanner:
Traceback (most recent call last):
  File "P:\Data\Plex Media Server\Scanners\Series\Absolute Series Scanner.py", line 375, in Scan
    season_ep1      = min([e[1] for e in tvdb_mapping.values() if e[0] == offset_season+1]) if match_source in ['tvdb3','tvdb4'] else 1
ValueError: min() arg is an empty sequence

One last thing needed, please provide what your file setup is so I can replicate. I have the folder setup from the first log but nothing for the actually filenames as its crashing before it's processes/posts that info into the log.

EndOfLine369 commented 8 years ago

Here is also what I have for a readme update.

EndOfLine369 commented 8 years ago

Examples of force guid in all modes and their applications:

When you have all episodes of a series in a single parent folder:

Advanced modes for when you have episodes of a series in SEPARATE parent folders but want them to show as a single series in Plex:

saitoh183 commented 8 years ago

File list http://pastebin.com/4dJ3Tt8d

EndOfLine369 commented 8 years ago

Found the issue. Was hit when using either 'tvdb3' or 'tvdb4' and has a defiend '-s0' offset. As 'tvdb_mapping' only has mapping for s1+ (no s0) thus the min() arg is an empty sequence https://gist.github.com/EndOfLine369/20159a2480502f0839fc

Please also have a read-through of the above readme update and get back if it doesn't makes sense.

ZeroQI commented 8 years ago

Updated readme https://github.com/ZeroQI/Absolute-Series-Scanner/blob/master/README.md with hte very descriptive info Should black lagoon be the following IF using tvdb 4 otherwise it doesn't use absolute numbering? We can't use anidb2 since tvdb consider two half season...

EndOfLine369 commented 8 years ago

No, as the offset should be using the tvdb4 seasons and not TheTVDB seasons.

EndOfLine369 commented 8 years ago

Fixed the readme as you did not copy in the actual text thus causing formatting issues.

EndOfLine369 commented 8 years ago

Oh, misinterpreted what you said. But still no as I have coded the scanner to where if either 'tvdb3' or 'tvdb4' is used, it finds the absolute number of e1 from the sY defined in the offset based off the tvdb_mapping info.

Was mentioned in https://github.com/ZeroQI/Absolute-Series-Scanner/issues/46#issuecomment-231307641 Code starts on this line https://gist.github.com/EndOfLine369/20159a2480502f0839fc#file-absolute-series-scanner-py-L374

saitoh183 commented 8 years ago

@EndofLine369

The readme is clearer for me anyways... I guess you will as time goes and depending on the questions that you get. I will attempt to retest bleach as soon as i can.

saitoh183 commented 8 years ago

@EndOfLine369

Might be good to mention that for example tvdb-XXXXX-sX works but tvdb-XXXXX-SX does not

sven-7 commented 8 years ago

Agree. Think the readme is much more clear now.

sven-7 commented 8 years ago

I know this is late, but I have my Black Lagoon all numbered absolutely. TVBD defines the first 24 as one season, because they don't consider split cour to be two seasons. Under specials, they have Roberta's Blood Trail, but they were also given absolute numbers because they chronologically follow.

AniDB considers it three separate shows. Thus, TVDB4 allows me to make it three seasons. Otherwise, my options would have been 2 seasons + specials, or three separate shows. tvdb4 gave me the best potential outcome, IMO.

Side note: I do Bakuman via tvdb2. I have the files numbered 1-75 and let the scanner/agent split it into seasons for me.

saitoh183 commented 8 years ago

Trying to do Fairy Tail and Fairy Tail (2014) but couldn't figure out which to use to get Season folders. So i ended up doing "Fairy Tail [tvdb2-114801]" (s01-S04 )and "Fairy Tail (2014) [tvdb2-114801-s5e1]". Was that the proper way to do it?

EndOfLine369 commented 8 years ago

@saitoh183 yeah. that should work i think. note you don't need the 'e1' though (doesn't hurt anything). It is implied to start at the first episode of the season used when using the season offset "[tvdb2-114801-s5]".

Did you get the Bleach movies working with the fix?

saitoh183 commented 8 years ago

yeah. that should work i think. note you don't need the 'e1' though. It is implied to start at the first episode of the season used when using the season offset "[tvdb2-114801-s5]".

Ok good to know

Did you get the Bleach movies working with the fix?

Yes everything is working...almost done with my 200+ anime ..lol for the most par i used tvdb-XXXX (with sX and/or eX) and a few with anidb2... Stuff with 60+ eps , i used tvdb3...so far so good

saitoh183 commented 8 years ago

I got a few hiccups with few series...i guess i with try other variations till i find the one that works...

saitoh183 commented 8 years ago

actually...there are many series that didnt work as i thought ...including Bleach series with tvdb3

EndOfLine369 commented 8 years ago

Staged the updates in a pull request to make it easier to fix before pushing to the master. Will merge and close this ticket on Friday unless you find any issues.

saitoh183 commented 8 years ago

using tvdb3 with Naruto Shippuden

Season 5:

image

eps 1 to 24 are trakt links (i dont know if this is due to the trakt plugin) and then right after episode 24 the first eps is listed as absolute number. So tvdb3 works as in it should but just not sure if the icons i see really from the trakt plugin in some way.

image

EndOfLine369 commented 8 years ago

The issue is probably in that your Trakt expects the episode numbers to reset to ep1 at each season which is not what 'tvdb3' does. If you want that, that is 'tvdb2'. As you can see that ep1 & ep89 have the same name so would expect that ep 89 is the absolute episode number for s5e1.

I would expect both 'tvdb3' & 'tvdb4' would have listing issues with your Track setup as both modes keep the episode numbers matching the absolute numbers.

This is a guess as I don't use Trakt.

saitoh183 commented 8 years ago

its fine, this was more of a observation...i do use tvdb2 instead since i want anime to work with trakt

@EndOfLine369 and @ZeroQI I also want to say Thanks for all the work and doing such a great job on this scanner. Its the best thing to happen to anime for media centers since slice bread :).

EndOfLine369 commented 8 years ago

Thanks for the praise. :blush: I'm glad I was able to assist in getting both ASS & HAMA to the point where it is today with this level of flexibility in available setup options.

ZeroQI commented 8 years ago

Thanks too.

The agent is possibly the only one doing movies and series in the same library @EndOfLine369 : you pushed HAMA and ASS to unique level of functionality. Now the scanner allow naming to be compatible with everything else since it's in brackets but to manipulate display without changing filenames, a must for big libraries or people using file renamers already... Can't think of anything to add to the scanner to be fair ...

Not many people used the scanner initially and some continued to used Babs whihc made me sad, but glad i sticked to it and it is awasome now :D

saitoh183 commented 8 years ago

Well with these new additions, i hope it will make more people switch over from. Babs

EndOfLine369 commented 8 years ago

I hadn't realized the amount of work I've done for this until I just looked at the commit histories. ASS History / HAHA History Might need to take a break :wink:

ZeroQI commented 8 years ago

@saitoh183 Is http://jmediamanager.org/ fully working with HAMA and ASS now ? Do you have any settings or recommendation? If so, i would like to add to the readme for everyone's benefits...

EndOfLine369 commented 8 years ago

@saitoh183 are these files placed by JMM?

2016-07-25 00:18:51 file: 'D:\Videos\Animehama\Gekijouban Bleach Fade to Black Kimi no Na o Yobu [tvdb3-74796-s0e5]\fanart.jpg', ext: 'jpg' not in video_ext
2016-07-25 00:18:51 file: 'D:\Videos\Animehama\Gekijouban Bleach Fade to Black Kimi no Na o Yobu [tvdb3-74796-s0e5]\poster.jpg', ext: 'jpg' not in video_ext
2016-07-25 00:18:51 file: 'D:\Videos\Animehama\Gekijouban Bleach Fade to Black Kimi no Na o Yobu [tvdb3-74796-s0e5]\season01-poster.jpg', ext: 'jpg' not in video_ext

@ZeroQI, if these are indeed placed by JMM, we don't currently have a "Load Local Metadata" option in HAMA.

saitoh183 commented 8 years ago

@ZeroQI

My anime is all managed by JMM. but the artwork is manual by me so that i dont have to search for the artwork i use.

As for JMM with HAMA/ASS, i have no issues. It has always worked well and it is the reason i started using HAMA in the first place. Now with the new additions i can still use jmm but conviently present anime in tvdb format in plex. The initial pain with using anidb is that everything is a separate series (movies, additional seasons, OVAs) which in turn makes navigating all of this in plex difficult for the common user. But on the flip side, it was easier to organize because jmm uses Hash and not file name and it made it easier to know which releases i was getting.

As for recommendations, i could post the jmm renaming script i use that allowed me to get proper scanning with the agent in plex which could help as a baseline for other users.

JMM is the best anime organizer around..it has lots of flexibility. The only 3 things it is really missing is multi platform support, Rutorrent and shanaproject intergration and TVDB formating support. Those things + Hama, would make it the ultimate anime management setup.

EndOfLine369 commented 8 years ago

I'll take you closing this ticket that you either finished your setup or most using this and found no issues. :grin:

ZeroQI commented 8 years ago

Wouldn't mind the script to add to the readme...