Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add List Feature #7

Open
ghost opened this issue Oct 18, 2021 · 0 comments
Open

Add List Feature #7

ghost opened this issue Oct 18, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants