Refresh stale SAB category ignores

Drop old ignored SAB rows before resync so fixed category parsing can take effect.
This commit is contained in:
2026-07-29 15:08:32 +02:00
parent 2ff670a9ae
commit 581934f7b5
3 changed files with 22 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
from importarr.state import State
def test_delete_queue_items_by_state_can_target_reason(tmp_path):
state = State(tmp_path / "state.db")
state.upsert_queue_item(source_type="sab", source_id="stale", name="Stale", state="ignored", reason="SAB category is not owned by Importarr")
state.upsert_queue_item(source_type="sab", source_id="other", name="Other", state="ignored", reason="other reason")
assert state.delete_queue_items_by_state("sab", "ignored", "SAB category is not owned by Importarr") == 1
rows = state.list_queue_items()
assert len(rows) == 1
assert rows[0]["source_id"] == "other"