modify scripts
This commit is contained in:
@ -132,6 +132,9 @@ class DatabaseHandler:
|
||||
def finalize_task_log(self, task_id):
|
||||
return 1
|
||||
|
||||
def get_statics(self):
|
||||
return {}
|
||||
|
||||
def close(self):
|
||||
self.cursor.close()
|
||||
self.conn.close()
|
||||
@ -517,4 +520,36 @@ class JavbusDBHandler(DatabaseHandler):
|
||||
except sqlite3.Error as e:
|
||||
logging.error(f"查询 href 失败: {e}")
|
||||
return None
|
||||
|
||||
|
||||
|
||||
# 查询状态
|
||||
def get_statics(self):
|
||||
result = {}
|
||||
try:
|
||||
# 获取 performers、studios 等表的最终行数
|
||||
self.cursor.execute(f"SELECT COUNT(*) FROM {self.tbl_name_actors} ")
|
||||
result['actors'] = self.cursor.fetchone()[0]
|
||||
|
||||
self.cursor.execute(f"SELECT COUNT(*) FROM {self.tbl_name_actors} where uncensored=1")
|
||||
result['actors_uncensored'] = self.cursor.fetchone()[0]
|
||||
|
||||
self.cursor.execute(f"SELECT COUNT(*) FROM {self.tbl_name_actors} where is_full_data=1")
|
||||
result['actors_full_data'] = self.cursor.fetchone()[0]
|
||||
|
||||
self.cursor.execute(f"SELECT COUNT(*) FROM {self.tbl_name_actors} where is_full_data=1 and is_full_data=1")
|
||||
result['actors_uncensored_full_data'] = self.cursor.fetchone()[0]
|
||||
|
||||
# 获取 performers、studios 等表的最终行数
|
||||
self.cursor.execute(f"SELECT COUNT(*) FROM {self.tbl_name_movies} ")
|
||||
result['movies'] = self.cursor.fetchone()[0]
|
||||
|
||||
self.cursor.execute(f"SELECT COUNT(*) FROM {self.tbl_name_movies} where uncensored=1")
|
||||
result['movies_uncensored'] = self.cursor.fetchone()[0]
|
||||
|
||||
self.cursor.execute(f"SELECT COUNT(*) FROM {self.tbl_name_movies} where is_full_data=1 and is_full_data=1")
|
||||
result['movies_uncensored_full_data'] = self.cursor.fetchone()[0]
|
||||
|
||||
except sqlite3.Error as e:
|
||||
logging.error(f"query error: {e}")
|
||||
|
||||
return result
|
||||
13
src/monitor/check_javbus.py
Normal file
13
src/monitor/check_javbus.py
Normal file
@ -0,0 +1,13 @@
|
||||
import json
|
||||
import time
|
||||
import src.db_utils.sqlite_db as sqlite_db
|
||||
db_tools = sqlite_db.JavbusDBHandler()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# 命令行参数处理
|
||||
result = db_tools.get_statics()
|
||||
print(result)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user