Commit 224934754b
Unsigned
Layout: unified · split
curd.py +6
| @@ -489,6 +489,8 @@ def select_anime(anime_list): | ||
| 489 | 489 | |
| 490 | 490 | # Filter the anime list based on current input |
| 491 | 491 | 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'] | |
| 492 | 494 | |
| 493 | 495 | # Ensure selected index is within bounds after filtering |
| 494 | 496 | if selected_index >= len(filtered_list): |
| @@ -500,6 +502,10 @@ def select_anime(anime_list): | ||
| 500 | 502 | except Exception as e: |
| 501 | 503 | # If an exception occurs, print it after exiting curses |
| 502 | 504 | curses.endwin() |
| 505 | print("e:", e) | |
| 506 | if e == 'No anime found': | |
| 507 | print("No anime selected.") | |
| 508 | exit(0) | |
| 503 | 509 | print(f"An error occurred: {e}") |
| 504 | 510 | finally: |
| 505 | 511 | # Ensure curses always exits cleanly |