From 17f1744025142019864f2a151a5cbda7e57d1153 Mon Sep 17 00:00:00 2001 From: Benexl Date: Mon, 11 Aug 2025 23:38:24 +0300 Subject: [PATCH] feat(watch-history): intelligently switch to repeating if was initially completed --- fastanime/cli/service/registry/service.py | 2 ++ fastanime/cli/service/watch_history/service.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/fastanime/cli/service/registry/service.py b/fastanime/cli/service/registry/service.py index 1cbeba6..f58dc99 100644 --- a/fastanime/cli/service/registry/service.py +++ b/fastanime/cli/service/registry/service.py @@ -191,6 +191,8 @@ class MediaRegistryService: else: if not index_entry.status: index_entry.status = UserMediaListStatus.WATCHING + elif index_entry.status == UserMediaListStatus.COMPLETED: + index_entry.status = UserMediaListStatus.REPEATING if last_watch_position: index_entry.last_watch_position = last_watch_position diff --git a/fastanime/cli/service/watch_history/service.py b/fastanime/cli/service/watch_history/service.py index af9dc3b..6a04aad 100644 --- a/fastanime/cli/service/watch_history/service.py +++ b/fastanime/cli/service/watch_history/service.py @@ -28,6 +28,11 @@ class WatchHistoryService: ) status = None + if ( + media_item.user_status + and media_item.user_status.status == UserMediaListStatus.COMPLETED + ): + status = UserMediaListStatus.REPEATING self.media_registry.update_media_index_entry( media_id=media_item.id, watched=True,