mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 21:29:36 +00:00
* Fix #919, check if video is in watched state before auto deleting * lint
This commit is contained in:
@@ -312,7 +312,14 @@ class DownloadPostProcess(DownloaderBase):
|
|||||||
print(f"auto delete older than {autodelete_days} days")
|
print(f"auto delete older than {autodelete_days} days")
|
||||||
now_lte = str(self.now - autodelete_days * 24 * 60 * 60)
|
now_lte = str(self.now - autodelete_days * 24 * 60 * 60)
|
||||||
data = {
|
data = {
|
||||||
"query": {"range": {"player.watched_date": {"lte": now_lte}}},
|
"query": {
|
||||||
|
"bool": {
|
||||||
|
"must": [
|
||||||
|
{"range": {"player.watched_date": {"lte": now_lte}}},
|
||||||
|
{"term": {"player.watched": True}},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"sort": [{"player.watched_date": {"order": "asc"}}],
|
"sort": [{"player.watched_date": {"order": "asc"}}],
|
||||||
}
|
}
|
||||||
self._auto_delete_watched(data)
|
self._auto_delete_watched(data)
|
||||||
@@ -327,6 +334,7 @@ class DownloadPostProcess(DownloaderBase):
|
|||||||
must_list = [
|
must_list = [
|
||||||
{"range": {"player.watched_date": {"lte": now_lte}}},
|
{"range": {"player.watched_date": {"lte": now_lte}}},
|
||||||
{"term": {"channel.channel_id": {"value": channel_id}}},
|
{"term": {"channel.channel_id": {"value": channel_id}}},
|
||||||
|
{"term": {"player.watched": True}},
|
||||||
]
|
]
|
||||||
data = {
|
data = {
|
||||||
"query": {"bool": {"must": must_list}},
|
"query": {"bool": {"must": must_list}},
|
||||||
|
|||||||
Reference in New Issue
Block a user