modify scripts

This commit is contained in:
oscarz
2025-04-05 12:09:21 +08:00
parent 37fef7c786
commit 343efa6b00
2 changed files with 14 additions and 2 deletions

View File

@ -286,7 +286,7 @@ def fetch_performers_detail():
# 获取新演员的列表 # 获取新演员的列表
while True: while True:
if force: # 从头逐个遍历 if force: # 从头逐个遍历
perfomers_list = db_tools.query_performer_hrefs(start_id=last_perfomer_id, order_by='id asc', limit=limit_count) perfomers_list = db_tools.query_performer_hrefs(start_id=last_perfomer_id, before_updated_at='2025-04-01 00:00:00', order_by='id asc', limit=limit_count)
else: # 只做更新 else: # 只做更新
perfomers_list = db_tools.query_performer_hrefs(is_full_data=0, limit=limit_count) perfomers_list = db_tools.query_performer_hrefs(is_full_data=0, limit=limit_count)
if len(perfomers_list) < 1: if len(perfomers_list) < 1:
@ -315,7 +315,7 @@ def fetch_movies_detail():
last_movie_id = 0 last_movie_id = 0
while True: while True:
if force: # 从头逐个遍历 if force: # 从头逐个遍历
movies_list = db_tools.query_movie_hrefs(start_id=last_movie_id, order_by='id asc', limit=limit_count) movies_list = db_tools.query_movie_hrefs(start_id=last_movie_id, before_updated_at='2025-04-01 00:00:00', order_by='id asc', limit=limit_count)
else: # 只做更新 else: # 只做更新
movies_list = db_tools.query_movie_hrefs(is_full_data=0, limit=limit_count) movies_list = db_tools.query_movie_hrefs(is_full_data=0, limit=limit_count)
if len(movies_list) < 1: if len(movies_list) < 1:

View File

@ -344,6 +344,12 @@ def query_performer_hrefs(**filters):
if "is_full_data" in filters: if "is_full_data" in filters:
sql += " AND is_full_data = ?" sql += " AND is_full_data = ?"
params.append(filters["is_full_data"]) params.append(filters["is_full_data"])
if "before_updated_at" in filters:
sql += " AND updated_at <= ?"
params.append(filters["before_updated_at"])
if "after_updated_at" in filters:
sql += " AND updated_at >= ?"
params.append(filters["after_updated_at"])
if "start_id" in filters: if "start_id" in filters:
sql += " AND id > ?" sql += " AND id > ?"
params.append(filters["start_id"]) params.append(filters["start_id"])
@ -754,6 +760,12 @@ def query_movie_hrefs(**filters):
if "is_full_data" in filters: if "is_full_data" in filters:
sql += " AND is_full_data = ?" sql += " AND is_full_data = ?"
params.append(filters["is_full_data"]) params.append(filters["is_full_data"])
if "before_updated_at" in filters:
sql += " AND updated_at <= ?"
params.append(filters["before_updated_at"])
if "after_updated_at" in filters:
sql += " AND updated_at >= ?"
params.append(filters["after_updated_at"])
if "start_id" in filters: if "start_id" in filters:
sql += " AND id > ?" sql += " AND id > ?"
params.append(filters["start_id"]) params.append(filters["start_id"])