Commit 3a45c73812

3a45c73812ca088085673afd4a3cdbe4147b65d0

parent: 3f41dbdeef

Unregistered key

Rushikesh Gaikwad <81632222+Wraient@users.noreply.github.com> · 2024-10-02 09:07 UTC
committer: <noreply@github.com>

Continue from where you left off last time using -c

Layout: unified · split

curd.py +3 −3
@@ -1094,6 +1094,7 @@ parser = argparse.ArgumentParser(description="Print a greeting message.")
1094parser.add_argument("-new", action='store_true', help="Add new anime to watching (optional)") 1094parser.add_argument("-new", action='store_true', help="Add new anime to watching (optional)")
1095parser.add_argument("-sub", action='store_true', help="Anime audio type (optional)") 1095parser.add_argument("-sub", action='store_true', help="Anime audio type (optional)")
1096parser.add_argument("-dub", action='store_true', help="Anime audio type (optional)") 1096parser.add_argument("-dub", action='store_true', help="Anime audio type (optional)")
1097parser.add_argument("-c", action='store_true', help="Continue last watching anime (optional)")
1097args = parser.parse_args() 1098args = parser.parse_args()
1098 1099
1099user_config = load_config() # python dictionary containing all the configs as key value pairs 1100user_config = load_config() # python dictionary containing all the configs as key value pairs
@@ -1133,10 +1134,9 @@ if args.new:
1133 1134
1134user_id, user_name = get_anilist_user_id(access_token) 1135user_id, user_name = get_anilist_user_id(access_token)
1135mark_episode_as_completed_at = get_userconfig_value(user_config, "percentage_to_mark_complete") 1136mark_episode_as_completed_at = get_userconfig_value(user_config, "percentage_to_mark_complete")
1136
1137anilist_user_data = download_anilist_data(access_token, user_id) 1137anilist_user_data = download_anilist_data(access_token, user_id)
1138anime_dict = extract_anime_info(anilist_user_data)[0] 1138anime_dict = extract_anime_info(anilist_user_data)[0]
1139select_anime(anime_dict) 1139if not args.c: select_anime(anime_dict)
1140anime_name = read_tmp("anime") 1140anime_name = read_tmp("anime")
1141write_to_tmp("query", anime_name) 1141write_to_tmp("query", anime_name)
1142run_script("anime_list") 1142run_script("anime_list")
@@ -1425,4 +1425,4 @@ while True:
1425 # print(f"error:{e}\nMaybe try running again!") 1425 # print(f"error:{e}\nMaybe try running again!")
1426 print_error(f"{e}") 1426 print_error(f"{e}")
1427 print("Maybe try running again!") 1427 print("Maybe try running again!")
1428 exit(1)\ No newline at end of file 1428 exit(1)