Improve request handling and qBittorrent categories
This commit is contained in:
@@ -609,6 +609,22 @@ def get_request_cache_count() -> int:
|
||||
return int(row[0] or 0)
|
||||
|
||||
|
||||
def update_request_cache_title(
|
||||
request_id: int, title: str, year: Optional[int] = None
|
||||
) -> None:
|
||||
if not title:
|
||||
return
|
||||
with _connect() as conn:
|
||||
conn.execute(
|
||||
"""
|
||||
UPDATE requests_cache
|
||||
SET title = ?, year = COALESCE(?, year)
|
||||
WHERE request_id = ?
|
||||
""",
|
||||
(title, year, request_id),
|
||||
)
|
||||
|
||||
|
||||
def prune_duplicate_requests_cache() -> int:
|
||||
with _connect() as conn:
|
||||
cursor = conn.execute(
|
||||
|
||||
Reference in New Issue
Block a user