Skip to content

Add List Feature #7

Description

Please add some feature to get the anime or manga list of an user, the list should include each entrys id.

I cant explain this really well, but you seemed to understand on Discord, so i just leave the codeblock for the jikanimplementation.

IJikan jikan = new Jikan(true);
                var random = new Random();
                List<string> list = new List<string>();

                site = 1;

                for (int i = 0; i < site; i++)
                {
                    UserAnimeList userAnime = await jikan.GetUserAnimeList(username, UserAnimeListExtension.PlanToWatch, site);
                    foreach (var anime in userAnime.Anime)
                    {
                        list.Add(anime.MalId.ToString());

                    }
                    if (userAnime.Anime.Count >= 299)
                    {
                        site++;
                    }
                }

                if (list.Count > 0)
                {
                    int index = random.Next(list.Count);

                    long malindex = Convert.ToInt64(list[index]);

                    Anime anime = await jikan.GetAnime(malindex);

                    animeInfo.animename = anime.Title;

                    animeInfo.animeimgurl = anime.ImageURL;

                    animeInfo.animeurl = "https://myanimelist.net/anime/" + anime.MalId;

                    animeInfo.animedesc = anime.Synopsis;

                    animeInfo.click = "Go to List Entry.";

                    return animeInfo;


Sorry for the bad code indentation, ill fix that tomorrow when im on pc again.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions