Commit 825313f772

825313f7721f616b993418ac07a25d044503e40f

parent: 7d92b0529c

Unsigned

Wraient <wraient.911@gmail.com> · 2024-09-24 20:37 UTC

percentage to mark complete is in conf

Layout: unified · split

curd.py +8 −2
@@ -24,7 +24,6 @@ from select_anime import extract_anime_info
24from select_anime import select_anime 24from select_anime import select_anime
25from track_anime import add_anime, update_anime, get_all_anime, delete_anime, find_anime 25from track_anime import add_anime, update_anime, get_all_anime, delete_anime, find_anime
26 26
27mark_episode_as_completed_at = 85
28discord_client_id = "1287457464148820089" 27discord_client_id = "1287457464148820089"
29 28
30def get_contents_of(tmp_file_name): 29def get_contents_of(tmp_file_name):
@@ -80,6 +79,7 @@ default_config = {
80 "history_file":"$HOME/.local/share/curd/curd_history.txt", 79 "history_file":"$HOME/.local/share/curd/curd_history.txt",
81 "subs_language":"english", 80 "subs_language":"english",
82 "sub_or_dub":"sub", 81 "sub_or_dub":"sub",
82 "percentage_to_mark_complete":85,
83 "next_episode_prompt": False, 83 "next_episode_prompt": False,
84 "score_on_completion": True, 84 "score_on_completion": True,
85 "save_mpv_speed": True, 85 "save_mpv_speed": True,
@@ -157,6 +157,11 @@ def load_config() -> dict:
157 elif value.lower() == "false": 157 elif value.lower() == "false":
158 value = False 158 value = False
159 159
160 try:
161 value = int(value)
162 except:
163 pass
164
160 # Store in the dictionary 165 # Store in the dictionary
161 config_dict[key] = value 166 config_dict[key] = value
162 167
@@ -226,7 +231,8 @@ if args.new:
226 print("No anime found") 231 print("No anime found")
227 232
228user_id, user_name = get_anilist_user_id(access_token) 233user_id, user_name = get_anilist_user_id(access_token)
229 234mark_episode_as_completed_at = get_userconfig_value(user_config, "percentage_to_mark_complete")
235print(mark_episode_as_completed_at)
230 236
231anilist_user_data = download_anilist_data(access_token, user_id) 237anilist_user_data = download_anilist_data(access_token, user_id)
232anime_dict = extract_anime_info(anilist_user_data)[0] 238anime_dict = extract_anime_info(anilist_user_data)[0]