mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2025-06-04 01:21:10 +00:00
only stamp watched date to watched videos (#926)
This commit is contained in:
parent
f53988b826
commit
6eb774be69
@ -43,14 +43,9 @@ class WatchState:
|
|||||||
def change_vid_state(self):
|
def change_vid_state(self):
|
||||||
"""change watched state of video"""
|
"""change watched state of video"""
|
||||||
path = f"ta_video/_update/{self.youtube_id}"
|
path = f"ta_video/_update/{self.youtube_id}"
|
||||||
data = {
|
data = {"doc": {"player": {"watched": self.is_watched}}}
|
||||||
"doc": {
|
if self.is_watched:
|
||||||
"player": {
|
data["doc"]["player"]["watched_date"] = self.stamp
|
||||||
"watched": self.is_watched,
|
|
||||||
"watched_date": self.stamp,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
response, status_code = ElasticWrap(path).post(data=data)
|
response, status_code = ElasticWrap(path).post(data=data)
|
||||||
key = f"{self.user_id}:progress:{self.youtube_id}"
|
key = f"{self.user_id}:progress:{self.youtube_id}"
|
||||||
RedisArchivist().del_message(key)
|
RedisArchivist().del_message(key)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user