feat(anilist): add update your anilist feature

This commit is contained in:
Benex254
2024-08-05 09:47:04 +03:00
parent 571bf7de83
commit 29444865d6

View File

@@ -427,7 +427,30 @@ def anilist_options(config, anilist_config: QueryDict):
anilist_options(config, anilist_config)
def _add_to_list(config: Config, anilist_config: QueryDict):
config.update_anime_list(anilist_config.anime_id)
# config.update_anime_list(anilist_config.anime_id)
anime_lists = {
"Watching": "CURRENT",
"Paused": "PAUSED",
"Planning": "PLANNING",
"Dropped": "DROPPED",
"Repeating": "REPEATING",
"Completed": "COMPLETED",
}
if config.use_fzf:
anime_list = fzf.run(
list(anime_lists.keys()),
"Choose the list you want to add to",
"Add your animelist",
)
else:
anime_list = fuzzy_inquirer(
"Choose the list you want to add to", list(anime_lists.keys())
)
AniList.update_anime_list(
{"status": anime_lists[anime_list], "mediaId": selected_anime["id"]}
)
print("Successfully updated your list")
input("Enter to continue...")
anilist_options(config, anilist_config)
def _remove_from_list(config: Config, anilist_config: QueryDict):