ZeroQI / Hama.bundle

Plex HTTP Anidb Metadata Agent (HAMA)
GNU General Public License v3.0
1.21k stars 114 forks source link

Upcoming changes to anime-list.xml #19

Closed ScudLee closed 8 years ago

ScudLee commented 9 years ago

Hi, I just wanted to let you know I'm making some changes to the anime-list.xml soon. This is to hopefully simplify and reduce a lot of the long lists of individual episode mappings that exist in the list. I'm assuming this will affect you.

The first change is a new episodeoffset attribute that can be added to an anime node.
This, as hopefully the name suggests, is a value that should be added to every (regular) anidb episode number to get the corresponding tvdb episode number (within the defaulttvdbseason). This is directly in response to the new policy on tvdb regarding split-cour series.

Example: (Current method)

  <anime anidbid="10760" tvdbid="278626" defaulttvdbseason="1">
    <name>Fate/Stay Night: Unlimited Blade Works (2015)</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="1">;1-13;2-14;3-15;4-16;5-17;6-18;7-19;8-20;9-21;10-22;11-23;12-24;13-25;</mapping>
    </mapping-list>
  </anime>

(New method)

  <anime anidbid="10760" tvdbid="278626" defaulttvdbseason="1" episodeoffset="12">
    <name>Fate/Stay Night: Unlimited Blade Works (2015)</name>
  </anime>

(Note that the offset is what gets added, it's not the number the first episode is mapped to.)

Alongside that I'm also adding an offset attribute within the mapping-list entries, together with start and end attributes to define the range of anidb episodes affected.

Example: (Current method)

  <anime anidbid="516" tvdbid="76045" defaulttvdbseason="1">
    <name>Princess Tutu</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="1">;1-1;2-2;3-3;4-4;5-5;6-6;7-7;8-8;9-9;10-10;11-11;12-12;13-13;</mapping>
      <mapping anidbseason="1" tvdbseason="2">;14-1;15-2;16-3;17-4;18-5;19-6;20-7;21-8;22-9;23-10;24-11;25-12;26-13;27-14;28-15;29-16;30-17;31-18;32-19;33-20;34-21;35-22;36-23;37-24;38-25;</mapping>
    </mapping-list>
  </anime>

(New method)

  <anime anidbid="516" tvdbid="76045" defaulttvdbseason="1">
    <name>Princess Tutu</name>
    <mapping-list>
      <mapping anidbseason="1" tvdbseason="1" start="1" end="13" offset="0"/>
      <mapping anidbseason="1" tvdbseason="2" start="14" end="38" offset="-13"/>
    </mapping-list>
  </anime>

(In both cases the first mapping is technically redundant, and I'll probably omit it when I update.)

The episodeoffset and offset attributes, and also individual episode mappings can all hypothetically occur in the same entry, but only the most specific should be applied to an episode.

individual mapping > offset > episodeoffset

The individual mappings also won't compensate for any offsets - e.g. if there's an episodeoffset of 12, but episodes 2 and 3 are swapped, the mapping would be ;2-15;3-14; not ;2-3;3-2;

No firm ETA on when this will go live, probably next week sometime, definitely before the end of October. I still need to finish writing the new scraper code (and test it!).

ZeroQI commented 9 years ago

Thank you very much for the descriptive explanation that helps greatly Am implementing it at last, have been more than a week in holidays, should have finished coding tomorrow. thanks again

ZeroQI commented 9 years ago

uploaded new version Order of processing and impact on the mappingList array in my code: 1 individual mapping: mappingList [ 's1exx' ] = 'sXeXX' 2 offset: mappingList [ 's1' ] = [start, end, offset] 3 episodeoffset: mappingList [ 'episodeoffset' ] = episodeoffset

Feel free to use any part of my code you see fit, and thanks for a great mapping file

ZeroQI commented 8 years ago

Implemented quite some time ago. thanks a lot for letting me know. I do support both movies and series in the same library, thanks to the Absolute Series Scanner i wrote Also do a collection of both movies and series using your movie collection + related anime field in AniDB, so i am grateful for your XML files that made it possible