Updated something random

This commit is contained in:
cronyakatsuki 2022-06-19 19:58:53 +02:00
parent 3a2e380add
commit b04b02f1e0

24
adl.py
View File

@ -29,7 +29,6 @@ GOOD_TITLES = ['Komi-san wa, Komyushou desu.',
'SK∞']
# exit function
def exit_adl():
sys.exit()
@ -39,26 +38,22 @@ def interupt_command(signum, frame):
exit_adl()
# colored print
def color_print(text):
print(f"\033[0;36m{text } \033[0m")
# colored watch primpt
def watch_prompt(title, episode, msg):
print(
f"Now {msg} \033[0;34m{title}\033[0m, episode \033[0;34m{str(episode)} \033[0m")
# colored input
def color_prommpt(text):
return input(f"\033[0;34m{text}\033[0m")
# retrieve new list
def retrieve_list(account):
color_print(f"Running trackma retrieve for account {account}...")
@ -66,7 +61,6 @@ def retrieve_list(account):
subprocess.run(CLEAR)
# retrieve updated list
def retrieve_list_update(account):
color_print(
@ -75,7 +69,6 @@ def retrieve_list_update(account):
subprocess.run(CLEAR)
# load list
def load_list(account):
alist = subprocess.run(["trackma", "-a", account, "list"],
@ -86,7 +79,6 @@ def load_list(account):
return alist
# exit prompt
def exit_ask():
while True:
@ -98,7 +90,6 @@ def exit_ask():
return
# check for problematic title
def check_title(title):
if title in PROBLEMATIC_TITLES:
@ -108,7 +99,6 @@ def check_title(title):
return title
# get chosen anime info
def get_info(choice):
# get index
@ -131,7 +121,6 @@ def get_info(choice):
return index, title, episode, score
# watch animes
def watch(title, episode, download, provider, download_location):
cmd = ['animdl']
@ -156,7 +145,6 @@ def watch(title, episode, download, provider, download_location):
os.chdir(CURRENT_DIR)
# next episode
def next_episode(title, episode, msg, download, provider, download_location):
if not download:
@ -179,21 +167,18 @@ def next_episode(title, episode, msg, download, provider, download_location):
watch(title, str(episode), download, provider, download_location)
# all from last watched
def all_from_last(title, episode, msg, download, provider, download_location):
watch_prompt(title, f"{str(episode)} all left episodes", msg)
watch(title, f'{str(episode + 1)}:', download, provider, download_location)
# all episode
def all_episodes(title, msg, download, provider, download_location):
watch_prompt(title, "all", msg)
watch(title, '1:', download, provider, download_location)
# watch from custom range
def custom_episode_range(title, msg, download, provider, download_location):
begginig = color_prommpt("Beggining of interval?: ")
@ -202,7 +187,6 @@ def custom_episode_range(title, msg, download, provider, download_location):
watch(title, f"{begginig}:{end}", download, provider, download_location)
# add to last watched m
def next_plus_n(title, episode, action, msg, download, provider, download_location):
watch_prompt(title, str(episode + int(action)), msg)
@ -210,14 +194,12 @@ def next_plus_n(title, episode, action, msg, download, provider, download_locati
download, provider, download_location)
# rewatch current episode
def rewatch_episode(title, episode, msg, download, provider, download_location):
watch_prompt(title, str(episode), msg)
watch(title, str(episode), download, provider, download_location)
# watch custom episode
def custom_episode(title, msg, download, provider, download_location):
episode = color_prommpt("Enter custom episode: ")
@ -225,7 +207,6 @@ def custom_episode(title, msg, download, provider, download_location):
watch(title, episode, download, provider, download_location)
# update title
def update_title(index, title, episode, account):
color_print(f"Current episode for {title} is {str(episode)}")
@ -239,7 +220,6 @@ def update_title(index, title, episode, account):
color_print("Skipping updating...")
# update score
def update_score(index, title, score, account):
color_print(f"Current score for {title} is {score}")
@ -252,7 +232,6 @@ def update_score(index, title, score, account):
color_print("Skipping updating...")
# update question
def update_question(index, title, episode, score, account):
while True:
@ -266,7 +245,6 @@ def update_question(index, title, episode, score, account):
break
# ask if you wanna continus watching
def wanna_continu_watch(download):
while True:
@ -280,7 +258,6 @@ def wanna_continu_watch(download):
return False
# ask if you wanna update title meta after watch
def wanna_update_title_after_watch(index, title, episode, score, download, account):
if not download:
@ -297,7 +274,6 @@ def wanna_update_title_after_watch(index, title, episode, score, download, accou
break
# choose what to do with episode
def choose_episode():
subprocess.run(CLEAR)