only stamp watched date to watched videos (#926)

This commit is contained in:
Jurrer 2025-05-10 18:02:08 +02:00 committed by GitHub
parent f53988b826
commit 6eb774be69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -43,14 +43,9 @@ class WatchState:
def change_vid_state(self):
"""change watched state of video"""
path = f"ta_video/_update/{self.youtube_id}"
data = {
"doc": {
"player": {
"watched": self.is_watched,
"watched_date": self.stamp,
}
}
}
data = {"doc": {"player": {"watched": self.is_watched}}}
if self.is_watched:
data["doc"]["player"]["watched_date"] = self.stamp
response, status_code = ElasticWrap(path).post(data=data)
key = f"{self.user_id}:progress:{self.youtube_id}"
RedisArchivist().del_message(key)