Added comments

This commit is contained in:
CronyAkatsuki 2021-07-03 12:32:35 +02:00
parent 67df5c2360
commit 1ff4f58dcd

22
adl.py
View File

@ -199,38 +199,55 @@ def choose_episode():
color_print(" S - Skip. Choose another show.") color_print(" S - Skip. Choose another show.")
return color_prommpt("Your choice? [N/l/a/i/0-9/r/c/u/s]: ") return color_prommpt("Your choice? [N/l/a/i/0-9/r/c/u/s]: ")
# main loop
while True: while True:
# retrieving the list on start
if retrieve: if retrieve:
retrieve_list(account) retrieve_list(account)
retrieve = False retrieve = False
# get the list of anime
alist = load_list(account) alist = load_list(account)
# choose an anime from the list
choice = iterfzf(iter_list(alist)) choice = iterfzf(iter_list(alist))
if choice: if choice:
# get the whole choice into a string
full_choice = "".join(choice) full_choice = "".join(choice)
# get the title
title = get_title(full_choice) title = get_title(full_choice)
# get current episode
episode = get_episode(full_choice) episode = get_episode(full_choice)
# get latest episode
last_episode = get_all_episodes(full_choice) last_episode = get_all_episodes(full_choice)
# get current score
score = get_score(full_choice) score = get_score(full_choice)
# the watch loop
while True: while True:
# choose what to do with the choosen anime
action = choose_episode() action = choose_episode()
# watch next episode
if action == "": if action == "":
next_episode(title, episode, player) next_episode(title, episode, player)
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# same
elif action == "n" or action == "N": elif action == "n" or action == "N":
next_episode(title, episode, player) next_episode(title, episode, player)
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# watch all left episodes
elif action == "l" or action == "L": elif action == "l" or action == "L":
all_from_last(title, episode,last_episode, player) all_from_last(title, episode,last_episode, player)
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# watch every episode available
elif action == "a" or action == "A": elif action == "a" or action == "A":
all_episodes(title, player) all_episodes(title, player)
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# custom range of episodes
elif action == "i" or action == "I": elif action == "i" or action == "I":
custom_episode_range(title, player) custom_episode_range(title, player)
if wanna_continu_watch(): if wanna_continu_watch():
@ -238,6 +255,7 @@ while True:
else: else:
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# something?
elif action == "1" or action == "2" or action == "3" or action == "4" or action == "5" or action == "6" or action == "7" or action == "8" or action == "9": elif action == "1" or action == "2" or action == "3" or action == "4" or action == "5" or action == "6" or action == "7" or action == "8" or action == "9":
next_plus_n(title, episode, player, action) next_plus_n(title, episode, player, action)
if wanna_continu_watch(): if wanna_continu_watch():
@ -245,6 +263,7 @@ while True:
else: else:
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# rewatch current episode
elif action == "r" or action == "R": elif action == "r" or action == "R":
rewatch_episode(title, episode, player) rewatch_episode(title, episode, player)
if wanna_continu_watch(): if wanna_continu_watch():
@ -252,6 +271,7 @@ while True:
else: else:
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# watch custom episode
elif action == "c" or action == "C": elif action == "c" or action == "C":
custom_episode(title, player) custom_episode(title, player)
if wanna_continu_watch(): if wanna_continu_watch():
@ -259,9 +279,11 @@ while True:
else: else:
wanna_update_title_after_watch(title, episode, score) wanna_update_title_after_watch(title, episode, score)
break break
# update anime meta
elif action == "u" or action == "U": elif action == "u" or action == "U":
update_question(title, episode, score) update_question(title, episode, score)
break break
# skip the anime
elif action == "s" or action == "S": elif action == "s" or action == "S":
break break
else: else: