From eaf6bb99575bd06e8eafbb7ce874deb26d3e8436 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sat, 1 Nov 2025 16:07:31 +0100 Subject: [PATCH] fix queue issues --- data/download_queue.json | 1135 ++++++++++++++++++++++++++--- src/server/web/static/js/queue.js | 28 +- 2 files changed, 1049 insertions(+), 114 deletions(-) diff --git a/data/download_queue.json b/data/download_queue.json index b2d0400..f5347ef 100644 --- a/data/download_queue.json +++ b/data/download_queue.json @@ -1,100 +1,5 @@ { "pending": [ - { - "id": "e8ddd58a-955c-4af0-ab44-18cda4d0797d", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 2, - "episode": 12, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.881780Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "b10dd8ba-549c-4028-86bd-2e59cce7ac4f", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 1, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.881808Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "dd858d7c-d45d-41fb-8535-0b0bd19c720f", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 2, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.881837Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "0129ee86-5aa2-4229-8aa3-834856ddd2fc", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 3, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.881883Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "55e21a17-ac91-4dfe-ba96-df5c4261a9a5", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 4, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.881920Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, { "id": "467b39ac-48be-48c5-a04c-ce94b6f6c0d9", "serie_id": "highschool-dxd", @@ -550,10 +455,7 @@ "error": "Download failed", "retry_count": 0, "source_url": null - } - ], - "active": [], - "failed": [ + }, { "id": "692899f4-baaf-48b1-8849-4cd214080976", "serie_id": "highschool-dxd", @@ -563,7 +465,7 @@ "episode": 1, "title": null }, - "status": "failed", + "status": "pending", "priority": "normal", "added_at": "2025-11-01T14:27:50.292481Z", "started_at": "2025-11-01T14:40:26.830855Z", @@ -582,7 +484,7 @@ "episode": 2, "title": null }, - "status": "failed", + "status": "pending", "priority": "normal", "added_at": "2025-11-01T14:27:50.292569Z", "started_at": "2025-11-01T14:41:09.633937Z", @@ -591,7 +493,1036 @@ "error": "Download failed", "retry_count": 0, "source_url": null + }, + { + "id": "c96e1314-2437-47a8-91f9-bf9dd4487835", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 1, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455502Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "a4f1f1f8-1645-4611-ae81-6fd08e29ad1b", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 2, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455594Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "786fa2a3-2a70-450b-94fe-8c81e4c3f33b", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 3, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455634Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "40ac8bf8-ac1c-4c3e-bbd0-829195785c39", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 4, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455666Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "b0f0a716-fed7-4595-bfa9-909ab9edf563", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 5, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455696Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "09fcf3ca-2f92-4cad-af92-1a9bedd7758a", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 6, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455727Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "0f243454-aed0-42af-8303-e0ac223c3206", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 7, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455755Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "ee29c5bd-80d9-4de3-a3d9-e096859a516d", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 8, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455783Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "3eef2fe9-b9a4-4a9d-89cd-b50fde99be0a", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 9, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455811Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "9a94d403-c57f-4e9f-bb93-9770b5cb3764", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 10, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455838Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "acb0a834-d3c6-4f79-abd6-63b7c066c977", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 11, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455865Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "c1c8d308-dc7d-4c1f-8334-60bc8038e394", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 1, + "episode": 12, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455892Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "a5cf222a-9aa2-4fdc-bd1a-4fd03d8dc27e", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 1, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455920Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "472f1780-6b28-4ca4-bed2-5fbc422f8381", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 2, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455947Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "3c081f8d-edd9-4b88-8958-ed7f32a57c40", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 3, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455973Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "e4508068-19f1-4611-9a1d-3b0cdd81e459", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 4, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.455999Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "05a0fcb3-e30e-49f7-90e8-524d0e77098e", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 5, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456040Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "70eb878f-9c6d-4b5b-ab28-769b22ea1380", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 6, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456068Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "c7ac6e32-3c40-4c38-84d5-51e1b6cb3e08", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 7, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456111Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "6b4a0cd2-3975-4326-9d4a-1ca0e28950ee", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 8, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456138Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "06a47cf9-4225-4f9c-b4c0-a4bf9576f537", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 9, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456166Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "0e942196-ae5c-4c3d-bcfc-525f70f5cac4", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 10, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456194Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "d56bda90-b7a0-43f8-b545-aab240859b8b", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 11, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456221Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "5d092239-ee61-4c20-a418-841dbd5bb6c8", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 12, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456249Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "9d6dd381-7672-4a99-b157-8bde5734627f", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 1, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456277Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "298d2e30-537e-40de-9bb7-4e11ac949fc3", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 2, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456304Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "070ef4ad-9267-4bf4-b2ea-d481b2acc946", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 3, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456331Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "f3e9611c-1ea0-4be7-8e7a-13550d9bea3d", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 4, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456358Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "ee037bc2-0708-4e36-b900-75033fee60aa", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 5, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456386Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "1cf8e98d-d27f-4145-99ef-b136e91de23a", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 6, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456413Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "903ec24b-9f39-4f70-ad3f-c0f17c7adfe4", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 7, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456440Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "554a6f95-49d4-49ea-98a2-e519233a4461", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 8, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456469Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "0a50d5cc-eea7-4efc-97d6-b20551b6c2de", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 9, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456496Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "1e5d23ac-5fa0-45a5-a914-1b6aa9cb7756", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 10, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456524Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "cdce29dc-2aca-473e-b6e8-2197d9dc0b05", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 11, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456550Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "88a0508e-0530-4b3d-b8ad-c56acc672286", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 12, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456577Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "c64e51db-aacf-4522-a42b-b5bc6588ece8", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 1, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456604Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "8249802e-306e-4099-9c0a-d1c32f3384fb", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 2, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456631Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "fb9d87a0-7e66-4699-8457-becfdb6b63f2", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 3, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456657Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "e115d882-e09f-4dc7-b318-41d6604e49b5", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 4, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456683Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "88286cab-7311-459f-8cb7-94eae0fba560", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 5, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456709Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "74ddaa0d-220d-410a-b512-593ff7fe84f9", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 6, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456735Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "8fdd6ec7-a2db-4bc7-95ff-b40556bb111c", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 7, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456760Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "5b25a2ce-8164-42eb-9efe-7821cd43dc67", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 8, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456787Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "05f2ef75-a3fd-484b-a4e2-1962138b8e82", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 9, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456813Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "27759a21-3a74-4cf7-a88a-05b26e2d889b", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 10, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456840Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "0beb1710-58d9-4d42-a62f-32f9e58c4e05", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 11, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456866Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "e2ebf54f-e56f-4719-9c13-35e84ef4ef05", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 12, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456892Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "b57e30ba-2818-4c19-b378-b99b947b6b81", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 4, + "episode": 13, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:56:25.456919Z", + "started_at": null, + "completed_at": null, + "progress": null, + "error": null, + "retry_count": 0, + "source_url": null + }, + { + "id": "e8ddd58a-955c-4af0-ab44-18cda4d0797d", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 2, + "episode": 12, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:30:56.881780Z", + "started_at": "2025-11-01T14:56:27.881263Z", + "completed_at": "2025-11-01T14:56:36.801211Z", + "progress": null, + "error": "Download failed", + "retry_count": 0, + "source_url": null + }, + { + "id": "b10dd8ba-549c-4028-86bd-2e59cce7ac4f", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 1, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:30:56.881808Z", + "started_at": "2025-11-01T14:57:10.276936Z", + "completed_at": "2025-11-01T14:57:16.504873Z", + "progress": null, + "error": "Download failed", + "retry_count": 0, + "source_url": null + }, + { + "id": "dd858d7c-d45d-41fb-8535-0b0bd19c720f", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 2, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:30:56.881837Z", + "started_at": "2025-11-01T14:59:52.176498Z", + "completed_at": "2025-11-01T15:00:01.750223Z", + "progress": null, + "error": "Download failed", + "retry_count": 0, + "source_url": null + }, + { + "id": "0129ee86-5aa2-4229-8aa3-834856ddd2fc", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 3, + "title": null + }, + "status": "pending", + "priority": "normal", + "added_at": "2025-11-01T14:30:56.881883Z", + "started_at": "2025-11-01T15:01:00.911739Z", + "completed_at": "2025-11-01T15:01:10.191654Z", + "progress": null, + "error": "Download failed", + "retry_count": 0, + "source_url": null } ], - "timestamp": "2025-11-01T14:42:24.118082+00:00" + "active": [], + "failed": [ + { + "id": "55e21a17-ac91-4dfe-ba96-df5c4261a9a5", + "serie_id": "highschool-dxd", + "serie_name": "Highschool DxD", + "episode": { + "season": 3, + "episode": 4, + "title": null + }, + "status": "failed", + "priority": "normal", + "added_at": "2025-11-01T14:30:56.881920Z", + "started_at": "2025-11-01T15:04:26.488261Z", + "completed_at": "2025-11-01T15:04:43.997982Z", + "progress": null, + "error": "Download failed", + "retry_count": 0, + "source_url": null + } + ], + "timestamp": "2025-11-01T15:04:43.998876+00:00" } \ No newline at end of file diff --git a/src/server/web/static/js/queue.js b/src/server/web/static/js/queue.js index e1e5783..dd30aa2 100644 --- a/src/server/web/static/js/queue.js +++ b/src/server/web/static/js/queue.js @@ -55,7 +55,8 @@ class QueueManager { }); this.socket.on('download_progress_update', (data) => { - this.updateDownloadProgress(data); + // Progress updates trigger a data reload to refresh the UI + this.loadQueueData(); }); // Download queue events @@ -69,7 +70,8 @@ class QueueManager { }); this.socket.on('download_progress', (data) => { - this.updateDownloadProgress(data); + // Progress updates trigger a data reload to refresh the UI + this.loadQueueData(); }); // Handle both old and new download completion events @@ -227,23 +229,26 @@ class QueueManager { } updateStatistics(stats, data) { - document.getElementById('total-items').textContent = stats.total_items || 0; + // Ensure stats object exists + const statistics = stats || {}; + + document.getElementById('total-items').textContent = statistics.total_items || 0; document.getElementById('pending-items').textContent = (data.pending_queue || []).length; - document.getElementById('completed-items').textContent = stats.completed_items || 0; - document.getElementById('failed-items').textContent = stats.failed_items || 0; + document.getElementById('completed-items').textContent = statistics.completed_items || 0; + document.getElementById('failed-items').textContent = statistics.failed_items || 0; // Update section counts document.getElementById('queue-count').textContent = (data.pending_queue || []).length; - document.getElementById('completed-count').textContent = stats.completed_items || 0; - document.getElementById('failed-count').textContent = stats.failed_items || 0; + document.getElementById('completed-count').textContent = statistics.completed_items || 0; + document.getElementById('failed-count').textContent = statistics.failed_items || 0; - document.getElementById('current-speed').textContent = stats.current_speed || '0 MB/s'; - document.getElementById('average-speed').textContent = stats.average_speed || '0 MB/s'; + document.getElementById('current-speed').textContent = statistics.current_speed || '0 MB/s'; + document.getElementById('average-speed').textContent = statistics.average_speed || '0 MB/s'; // Format ETA const etaElement = document.getElementById('eta-time'); - if (stats.eta) { - const eta = new Date(stats.eta); + if (statistics.eta) { + const eta = new Date(statistics.eta); const now = new Date(); const diffMs = eta - now; @@ -445,7 +450,6 @@ class QueueManager { document.getElementById('start-queue-btn').style.display = 'inline-flex'; } - document.getElementById('clear-queue-btn').disabled = !hasPending; document.getElementById('retry-all-btn').disabled = !hasFailed; document.getElementById('clear-completed-btn').disabled = !hasCompleted; document.getElementById('clear-failed-btn').disabled = !hasFailed;