Commit 224934754b

224934754b89e6de6260df29dc716311fa0341dd

parent: 88755d6f19

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-06 06:54 UTC

better anime selection

Layout: unified · split

curd.py +6
@@ -489,6 +489,8 @@ def select_anime(anime_list):
489489
490490 # Filter the anime list based on current input
491491 filtered_list = [anime for anime in anime_list.keys() if current_input.lower() in anime.lower()]
492 if filtered_list == []:
493 filtered_list = ['No anime found']
492494
493495 # Ensure selected index is within bounds after filtering
494496 if selected_index >= len(filtered_list):
@@ -500,6 +502,10 @@ def select_anime(anime_list):
500502 except Exception as e:
501503 # If an exception occurs, print it after exiting curses
502504 curses.endwin()
505 print("e:", e)
506 if e == 'No anime found':
507 print("No anime selected.")
508 exit(0)
503509 print(f"An error occurred: {e}")
504510 finally:
505511 # Ensure curses always exits cleanly