Fix: Remove episodes from missing list on download/rescan

- Update _update_series_in_db to sync missing episodes bidirectionally
- Add delete_by_series_and_episode method to EpisodeService
- Remove downloaded episodes from DB after successful download
- Clear anime service cache when episodes are removed
- Fix tests to use 'message' instead of 'detail' in API responses
- Mock DB operations in rescan tests
This commit is contained in:
2025-12-15 16:17:34 +01:00
parent bf332f27e0
commit 4c9bf6b982
8 changed files with 182 additions and 33 deletions

View File

@@ -236,7 +236,7 @@ async def test_add_to_queue_service_error(
)
assert response.status_code == 400
assert "Queue full" in response.json()["detail"]
assert "Queue full" in response.json()["message"]
@pytest.mark.asyncio
@@ -294,8 +294,8 @@ async def test_start_download_empty_queue(
assert response.status_code == 400
data = response.json()
detail = data["detail"].lower()
assert "empty" in detail or "no pending" in detail
message = data["message"].lower()
assert "empty" in message or "no pending" in message
@pytest.mark.asyncio
@@ -311,8 +311,8 @@ async def test_start_download_already_active(
assert response.status_code == 400
data = response.json()
detail_lower = data["detail"].lower()
assert "already" in detail_lower or "progress" in detail_lower
message_lower = data["message"].lower()
assert "already" in message_lower or "progress" in message_lower
@pytest.mark.asyncio