1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! # Mal_Query
//! This crate connects to the MyAnimeList public API v2 Beta, and allows the user to intuitively receive anime
//! data.
//! # Examples
//! ```
//! use mal_query::myanimelist::{
//! self,
//! builders::*,
//! models::*,
//! retrieval::*,
//! user::*
//! }
//!
//! #[tokio::main]
//! async fn example() {
//! // Logging in
//! match myanimelist::login().await {
//! Ok(()) => println!("Login Successful"),
//! Err(e) => eprintln!("Error: {e}"),
//! }
//!
//! // Searching for anime, getting 5 anime with title, id, and main_picture data
//! let one_search: MalAnimeSearch = search_anime("One Piece", 5).await.unwrap();
//!
//! // Getting anime by MyAnimeList ID, getting full MyAnimeList details
//! let one_piece_detailed: MalAnimeData = get_anime(21).await.unwrap();
//!
//! // Getting seasonal data, getting every available anime, with title, id, and main_picture data
//! let winter_2023: MalAnimeSearch = get_season(2023, Season::Winter).await.unwrap();
//!
//! // Getting anime by MyAnimeList URL, getting full MyAnimeList details
//! let one_piece_by_url: MalAnimeData = get_anime_from_url("https://myanimelist.net/anime/21/One_Piece").await.unwrap();
//!
//! // Gets the top 10 anime of all time, according to MyAnimeList, with title, id, and main_picture data
//! let rankings: MalAnimeSearch = get_anime_rankings(RankingType::All, 10).await.unwrap();
//!
//! // Gets 10 anime entries from a user's database, as long as it is public, or logged in. It contains title, id, and main_picture data
//! let test10 = get_user_animelist("naginis_api", 10).await.unwrap();
//!
//! // Builder to receive specific data from MyAnimeList. Here, title, id, main_picture, rank, and num_episodes
//! // There are 3 types of Builders: Builder, SearchBuilder, and SeasonalBuilder
//! // All have the same field addons, more in the docs
//! let one_piece_builder: MalAnimeData = Builder::new(21)
//! .add_rank()
//! .add_num_episodes()
//! .run()
//! .await
//! .unwrap();
//!
//! // UpdateAnime updates an anime in the user's database. The user must be logged in for this to work.
//! // `new` can be replace with `from_malanimedata`, to use a MalAnimeData type
//! let one_piece_update: ListStatus = UpdateAnime::new(21)
//! .update_score(10)
//! .expect("Score is invalid")
//! .update()
//! .await
//! .unwrap();
//!
//! // UserListBuilder receives specific data from a user's list. Here, it is sorted by score, limited by 10,
//! // and includes their list status.
//! let user_list = UserListBuilder::new("naginis_api")
//! .sort(Sort::ListScore)
//! .limit(10)
//! .include_list_status()
//! .run()
//! .await
//! .unwrap();
//! }
//! ```
// TODO: Launch 1.0
// TODO: Update README to include all data
// TODO: feature: append_fields to builds, find intuitive way to add many fields, or Fields::All
// TODO: Manga model MalMangaData
// TODO: search_manga(?)
// TODO: get_manga(?)
// TODO: get_manga_rankings(?)
// TODO: get_manga_by_url(?)
// TODO: Various builders
// TODO: update manga
// TODO: delete manga
// TODO: get_user_mangalist
// -- Jikan --
// TODO: get_anime
// TODO: get_anime_characters
// TODO: get_anime_staff
// etc. https://docs.api.jikan.moe/