feat(watch-history): intelligently switch to repeating if was initially completed

This commit is contained in:
Benexl
2025-08-11 23:38:24 +03:00
parent 9a5f3d46be
commit 17f1744025
2 changed files with 7 additions and 0 deletions

View File

@@ -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

View File

@@ -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,