Expose more fields from MyAnimeList in Atarashii API

Issue #106 resolved
Gustavo Rodrigues created an issue

An example to explain it better: from the AnimeListController.php code the "/animelist/[username]" endpoint basically is "malappinfo.php" serialized in the internal anime model than exported in JSON.

The problem is that some fields from MyAnimelist aren't exposed in that endpoint, like my_tags and my_last_updated, which could be used in in anime info and for "sorting by last modified" (a history page shows episodes but a sorted animelist shows anime entries, making lists more organized for some users), maybe they can be also used in other parts of the app.

The issue is named "more fields", not "all fields", as some fields aren't working, like my_id, and fields like my_rewatching and my_rewatching_ep are harder to handle (even the "other MAL apps" have problems with those fields).

Comments (7)

  1. Ratan Dhawtal

    @motokochan These details are inside a loop.

    foreach ($animelistxml->anime as $anime) {
                    $alist[$i] = new Anime();
                    $alist[$i]->setId((int) $anime->series_animedb_id);
                    $alist[$i]->setTitle((string) $anime->series_title);
                    $alist[$i]->setType((int) $anime->series_type);
                    $alist[$i]->setStatus((int) $anime->series_status);
                    $alist[$i]->setEpisodes((int) $anime->series_episodes);
                    $alist[$i]->setImageUrl((string) $anime->series_image);
                    $alist[$i]->setListedAnimeId((int) $anime->my_id);
                    $alist[$i]->setWatchedEpisodes((int) $anime->my_watched_episodes);
                    $alist[$i]->setScore((int) $anime->my_score);
                    $alist[$i]->setWatchedStatus((int) $anime->my_status);
                    ++$i;
    }
    

    How could we check the apiVersion the best way since this request will only available for 2.2+

  2. Michael Johnson

    Don't check the version in the parser. Use annotations in the model. Those will determine what to expose or not.

  3. Ratan Dhawtal

    personal_tags is used by the anime parser. The model method would go against the animeparser documentation.

  4. Kyle Lanchman

    Just to build a little on Gustavo's original info, it actually looks like my_rewatching works correctly - 1 if currently rewatching, 0 if not. Assuming that's the case, I think that'd be a useful field to include.

  5. Ratan Dhawtal

    That is some useful information Kyle, thanks. I will double check if it does work and add these requests for API 2.2. If things go all right today I could implement later.

  6. Log in to comment