ZeroQI / Hama.bundle

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

Wrong MyAnimeList ID used for Yuru Camp #470

Closed brw closed 2 years ago

brw commented 2 years ago

Hama seems to use the wrong MAL ID for Yuru Camp/Laid-Back Camp. Instead of Yuru Camp (34798), it uses the ID for Heya Camp (38476), which is part of the specials according to TVDB.

The log seems to show everything going fine until it fetches data from MAL where it just uses the wrong ID. Mappings seem fine to me so I don't think it's an AnimeLists issue but maybe I'm overlooking something there.

I'm using MAL for rating and originally_available_at and I just noticed those being wrong.

Laid-Back Camp [tvdb-330692].agent-update.log

ZeroQI commented 2 years ago

"Laid-Back Camp [tvdb-330692]/Season 1/Laid-Back Camp - S01E11 - Bluray-1080p x264 FLAC [UDF].mkv"

No MAL id in mapping file [https://raw.githubusercontent.com/Anime-Lists/anime-lists/master/anime-list-master.xml], normal it is given by ANiDB. Let's look at anidb ep mapping and which AniDB entities are actually present on disk and their respective numbering:

=== AniDB.GetMetadata() =====================================================================================================================================
Source: tvdb, AniDBid: 12743, Full AniDBids list: ['14437', '12743', '14439', '14438'], Active AniDBids list: ['14437', '14439', '12743']
[+] 12743: ['s1e1', 's1e2', 's1e3', 's1e4', 's1e5', 's1e6', 's1e7', 's1e8', 's1e9', 's1e10', 's1e11', 's1e12']
[+] 14437: ['s2e1', 's2e2', 's2e3', 's2e4', 's2e5', 's2e6', 's2e7', 's2e8', 's2e9', 's2e10', 's2e11', 's2e12', 's2e13']
[+] 14439: ['s0e5(s1e1)', 's0e6(s1e2)', 's0e7(s1e3)', 's0e8(s1e4)', 's0e9(s1e5)', 's0e10(s1e6)', 's0e11(s1e7)', 's0e12(s1e8)', 's0e13(s1e9)', 's0e14(s1e10)', 's0e15(s1e11)', 's0e16(s1e12)', 's0e17']

AniDB show the following MALid:

--- 14439.summary info --------------------------------------------------------------------------------------------------------------------------------------
ANNid: '22482', MALid: '38476', xml loaded: 'True'
--- 12743.summary info --------------------------------------------------------------------------------------------------------------------------------------
ANNid: '20010', MALid: '37341', xml loaded: 'True'
--- 14437.summary info --------------------------------------------------------------------------------------------------------------------------------------
ANNid: '24384', MALid: '38474', xml loaded: 'True'
--- 14439.summary info --------------------------------------------------------------------------------------------------------------------------------------
ANNid: '22482', MALid: '38476', xml loaded: 'True'

Currently a single MyAnimeList ID is loaded and the last one from the list

MALid 37341 is correct for first season and would be the one to use Code should be amended to use the one from the anidb entry matching Defaulttvdbseason=='1' when there is already one present

brw commented 2 years ago

Oh, thanks for the explanation! I thought I did see MALid 34798 in there somewhere but I must've been mistaken. In this case with the data returned from AniDB MALid 37341 would be the correct one to pick yes.

Although it is interesting to me that http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=12743 seems to return two externalentity fields. Only the first one, MALid 37341, is used by Hama. The second (and correct) one, MALid 34798, is seemingly discarded?

ZeroQI commented 2 years ago
<resource type="2">
<externalentity>
<identifier>37341</identifier>
</externalentity>
<externalentity>
<identifier>34798</identifier>
</externalentity>
</resource>

Indeed, never had that case, unsure which one to load then... SHould we always pick the first, the second, the lowest or highest ID ?

brw commented 2 years ago

Yuru Camp Season 1: http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=12743

<resource type="2">
    <externalentity>
        <!-- Season 1 specials -->
        <identifier>37341</identifier>
    </externalentity>
    <externalentity>
        <!-- Season 1 -->
        <identifier>34798</identifier>
    </externalentity>
</resource>

Yuru Camp Season 2: http://api.anidb.net:9001/httpapi?request=anime&client=hama&clientver=1&protover=1&aid=14437

<resource type="2">
    <externalentity>
        <!-- Season 2 -->
        <identifier>38474</identifier>
    </externalentity>
    <externalentity>
        <!-- Season 2 specials -->
        <identifier>49026</identifier>
    </externalentity>
</resource>

The order does not seem to be consistent, but I assume that the lower number generally corresponds to the main show, since I'd think specials are usually added later. I don't know if this is always the case though.

ZeroQI commented 2 years ago

Honestly, that's the best we have so far

ZeroQI commented 2 years ago

MaL API is retired so disabled it, so closing this ticket. You can reopen if a PR is done to ad MaL API (jikan for example) and issue persist, but i don't see that happening