From e75ffb603ccc710c8e191450991f5efb5f4c98f4 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 16 Dec 2023 13:13:48 +0700 Subject: [PATCH] fix auto delete lte datatype, #622 --- tubearchivist/home/src/download/yt_dlp_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tubearchivist/home/src/download/yt_dlp_handler.py b/tubearchivist/home/src/download/yt_dlp_handler.py index efcdb9b..6bf2c95 100644 --- a/tubearchivist/home/src/download/yt_dlp_handler.py +++ b/tubearchivist/home/src/download/yt_dlp_handler.py @@ -50,7 +50,7 @@ class DownloadPostProcess: return print(f"auto delete older than {autodelete_days} days") - now_lte = self.now - autodelete_days * 24 * 60 * 60 + now_lte = str(self.now - autodelete_days * 24 * 60 * 60) data = { "query": {"range": {"player.watched_date": {"lte": now_lte}}}, "sort": [{"player.watched_date": {"order": "asc"}}], @@ -63,7 +63,7 @@ class DownloadPostProcess: if "autodelete_days" in value: autodelete_days = value.get("autodelete_days") print(f"{channel_id}: delete older than {autodelete_days}d") - now_lte = self.now - autodelete_days * 24 * 60 * 60 + now_lte = str(self.now - autodelete_days * 24 * 60 * 60) must_list = [ {"range": {"player.watched_date": {"lte": now_lte}}}, {"term": {"channel.channel_id": {"value": channel_id}}},