Keep removed watchlist shows from reappearing
This commit is contained in:
@@ -871,6 +871,26 @@ class DownloadQueue:
|
||||
covered.update(self._expand_episode_spec((row["episodes"] if isinstance(row, sqlite3.Row) else row[0]), available_episodes))
|
||||
return covered
|
||||
|
||||
def detach_show(self, show_id):
|
||||
normalized_show_id = str(show_id or "").strip()
|
||||
if not normalized_show_id:
|
||||
return {"ok": True, "count": 0}
|
||||
count = 0
|
||||
with self.lock, self._connect() as conn:
|
||||
rows = conn.execute("SELECT * FROM jobs WHERE show_id = ?", (normalized_show_id,)).fetchall()
|
||||
for row in rows:
|
||||
job = self._job_from_row(row)
|
||||
job["show_id"] = ""
|
||||
job["skip_watchlist_sync"] = True
|
||||
job["updated_at"] = now_iso()
|
||||
self._upsert_job_conn(conn, job)
|
||||
count += 1
|
||||
if self.current_job is not None and str(self.current_job.get("show_id") or "").strip() == normalized_show_id:
|
||||
self.current_job["show_id"] = ""
|
||||
self.current_job["skip_watchlist_sync"] = True
|
||||
self.current_job["updated_at"] = now_iso()
|
||||
return {"ok": True, "count": count}
|
||||
|
||||
def retry(self, job_id):
|
||||
with self.lock:
|
||||
job = self._find(job_id)
|
||||
|
||||
Reference in New Issue
Block a user