diff --git a/data/download_queue.json b/data/download_queue.json index a016e93..fc92a62 100644 --- a/data/download_queue.json +++ b/data/download_queue.json @@ -1,1470 +1,6 @@ { - "pending": [ - { - "id": "7e80b3c4-6837-4af7-bea3-ca037df594ce", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 8, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882385Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "b668aa3f-bfc5-4355-b851-007017a56c2e", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 9, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882411Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "616fc8e5-4987-459e-977c-425649f48215", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 10, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882437Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "d911c56f-e347-432a-83af-cf3cdc1f8d84", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 11, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882465Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "a5ed1e19-051c-45ca-9ba3-d36de872aa41", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 12, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882492Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "d4ef1c1a-30b0-4f99-85fb-59b947a969f5", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 13, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882519Z", - "started_at": null, - "completed_at": null, - "progress": null, - "error": null, - "retry_count": 0, - "source_url": null - }, - { - "id": "07230ffe-1b77-41b4-85f6-1e110b8ca76a", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 1, - "episode": 1, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:06:39.995302Z", - "started_at": "2025-11-01T14:10:18.914729Z", - "completed_at": "2025-11-01T14:10:25.702201Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "4fd07de6-c4b3-4917-9d63-adfd6e8a4e8c", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 1, - "episode": 2, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:06:39.995380Z", - "started_at": "2025-11-01T14:10:49.550025Z", - "completed_at": "2025-11-01T14:10:55.477171Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "2df7af08-2ea1-4d10-8e88-b61b3241b2f0", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 1, - "episode": 3, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:06:39.995420Z", - "started_at": "2025-11-01T14:11:50.395385Z", - "completed_at": "2025-11-01T14:11:57.999387Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "692899f4-baaf-48b1-8849-4cd214080976", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 1, - "episode": 1, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:27:50.292481Z", - "started_at": "2025-11-01T14:40:26.830855Z", - "completed_at": "2025-11-01T14:40:37.287169Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "255fd20e-456e-45ff-b141-9a4b86daa789", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 1, - "episode": 2, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:27:50.292569Z", - "started_at": "2025-11-01T14:41:09.633937Z", - "completed_at": "2025-11-01T14:41:22.204881Z", - "progress": null, - "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 - }, - { - "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": "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 - }, - { - "id": "467b39ac-48be-48c5-a04c-ce94b6f6c0d9", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 5, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.881950Z", - "started_at": "2025-11-01T15:12:21.534113Z", - "completed_at": "2025-11-01T15:12:30.481928Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "4c0b9bd0-52ad-4833-baf7-19e2c920f94f", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 6, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.881979Z", - "started_at": "2025-11-01T15:12:31.484945Z", - "completed_at": "2025-11-01T15:12:39.118803Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "fabf8a46-6588-4dff-959d-de5e2bf48e29", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 7, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882013Z", - "started_at": "2025-11-01T15:12:40.122525Z", - "completed_at": "2025-11-01T15:12:46.419411Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "e02d144f-9939-41fe-bd02-0d52d581df4a", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 9, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882082Z", - "started_at": "2025-11-01T15:26:12.854334Z", - "completed_at": "2025-11-01T15:26:24.812576Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "6d5577e4-cab3-4be9-8eda-691a9af27517", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 10, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882111Z", - "started_at": "2025-11-01T15:26:25.815381Z", - "completed_at": "2025-11-01T15:26:34.238411Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "d63fbe5a-7a04-4a40-9ddc-423396d30140", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 11, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882139Z", - "started_at": "2025-11-01T15:26:35.243481Z", - "completed_at": "2025-11-01T15:26:48.941639Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "16bd4821-59f8-4071-a094-552db51af475", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 3, - "episode": 12, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882168Z", - "started_at": "2025-11-01T15:29:33.025257Z", - "completed_at": "2025-11-01T15:29:39.632532Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "0c4997aa-7d08-4290-83f1-85eceb5366c3", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 1, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882195Z", - "started_at": "2025-11-01T15:29:40.635705Z", - "completed_at": "2025-11-01T15:29:46.127792Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "f8c2dda3-51e4-4748-b282-e72258f2be14", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 2, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882222Z", - "started_at": "2025-11-01T15:29:47.131371Z", - "completed_at": "2025-11-01T15:29:53.137111Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "c123676c-6539-4d79-b785-0b670f78fae3", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 3, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882250Z", - "started_at": "2025-11-01T15:29:54.140657Z", - "completed_at": "2025-11-01T15:30:00.057079Z", - "progress": null, - "error": "Download failed", - "retry_count": 0, - "source_url": null - }, - { - "id": "3299eb0c-b275-444d-a951-86004cfe4f84", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 4, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882277Z", - "started_at": "2025-11-01T15:34:02.748613Z", - "completed_at": "2025-11-01T15:34:20.898926Z", - "progress": null, - "error": "Download returned False", - "retry_count": 0, - "source_url": null - }, - { - "id": "22f9ccd9-46ff-4964-ad84-a4f525a2d1f4", - "serie_id": "highschool-dxd", - "serie_name": "Highschool DxD", - "episode": { - "season": 4, - "episode": 5, - "title": null - }, - "status": "pending", - "priority": "normal", - "added_at": "2025-11-01T14:30:56.882304Z", - "started_at": "2025-11-01T15:34:21.901795Z", - "completed_at": "2025-11-01T15:34:44.840985Z", - "progress": null, - "error": "Download returned False", - "retry_count": 0, - "source_url": null - } - ], + "pending": [], "active": [], "failed": [], - "timestamp": "2025-11-01T15:48:49.007428+00:00" + "timestamp": "2025-11-01T17:06:01.216246+00:00" } \ No newline at end of file diff --git a/src/server/api/download.py b/src/server/api/download.py index 5198eb6..f707b2f 100644 --- a/src/server/api/download.py +++ b/src/server/api/download.py @@ -232,6 +232,40 @@ async def clear_failed( ) +@router.delete("/pending", status_code=status.HTTP_200_OK) +async def clear_pending( + _: dict = Depends(require_auth), + download_service: DownloadService = Depends(get_download_service), +): + """Clear all pending downloads from the queue. + + Removes all pending download items from the queue. This is useful for + clearing the entire queue at once instead of removing items one by one. + + Requires authentication. + + Returns: + dict: Status message with count of cleared items + + Raises: + HTTPException: 401 if not authenticated, 500 on service error + """ + try: + cleared_count = await download_service.clear_pending() + + return { + "status": "success", + "message": f"Removed {cleared_count} pending item(s)", + "count": cleared_count, + } + + except Exception as e: + raise HTTPException( + status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, + detail=f"Failed to clear pending items: {str(e)}", + ) + + @router.delete("/{item_id}", status_code=status.HTTP_204_NO_CONTENT) async def remove_from_queue( item_id: str = Path(..., description="Download item ID to remove"), diff --git a/src/server/models/download.py b/src/server/models/download.py index b330e78..6f09f76 100644 --- a/src/server/models/download.py +++ b/src/server/models/download.py @@ -27,9 +27,9 @@ class DownloadStatus(str, Enum): class DownloadPriority(str, Enum): """Priority level for download queue items.""" - LOW = "low" - NORMAL = "normal" - HIGH = "high" + LOW = "LOW" + NORMAL = "NORMAL" + HIGH = "HIGH" class EpisodeIdentifier(BaseModel): @@ -175,9 +175,9 @@ class DownloadRequest(BaseModel): @field_validator('priority', mode='before') @classmethod def normalize_priority(cls, v): - """Normalize priority to lowercase for case-insensitive matching.""" + """Normalize priority to uppercase for case-insensitive matching.""" if isinstance(v, str): - return v.lower() + return v.upper() return v diff --git a/src/server/services/download_service.py b/src/server/services/download_service.py index bc9ff44..e850c3f 100644 --- a/src/server/services/download_service.py +++ b/src/server/services/download_service.py @@ -600,6 +600,34 @@ class DownloadService: return count + async def clear_pending(self) -> int: + """Clear all pending downloads from the queue. + + Returns: + Number of items cleared + """ + count = len(self._pending_queue) + self._pending_queue.clear() + self._pending_items_by_id.clear() + logger.info("Cleared pending items", count=count) + + # Save queue state + self._save_queue() + + # Broadcast queue status update + if count > 0: + queue_status = await self.get_queue_status() + await self._broadcast_update( + "queue_status", + { + "action": "pending_cleared", + "cleared_count": count, + "queue_status": queue_status.model_dump(mode="json"), + }, + ) + + return count + async def retry_failed( self, item_ids: Optional[List[str]] = None ) -> List[str]: diff --git a/src/server/web/static/js/queue.js b/src/server/web/static/js/queue.js index 6d0459e..7080547 100644 --- a/src/server/web/static/js/queue.js +++ b/src/server/web/static/js/queue.js @@ -142,6 +142,10 @@ class QueueManager { this.clearQueue('failed'); }); + document.getElementById('clear-pending-btn').addEventListener('click', () => { + this.clearQueue('pending'); + }); + document.getElementById('retry-all-btn').addEventListener('click', () => { this.retryAllFailed(); }); @@ -442,6 +446,14 @@ class QueueManager { const hasFailed = (data.failed_downloads || []).length > 0; const hasCompleted = (data.completed_downloads || []).length > 0; + console.log('Button states update:', { + hasPending, + pendingCount: (data.pending_queue || []).length, + hasActive, + hasFailed, + hasCompleted + }); + // Enable start button only if there are pending items and no active downloads document.getElementById('start-queue-btn').disabled = !hasPending || hasActive; @@ -458,17 +470,28 @@ class QueueManager { document.getElementById('retry-all-btn').disabled = !hasFailed; document.getElementById('clear-completed-btn').disabled = !hasCompleted; document.getElementById('clear-failed-btn').disabled = !hasFailed; + + // Update clear pending button if it exists + const clearPendingBtn = document.getElementById('clear-pending-btn'); + if (clearPendingBtn) { + clearPendingBtn.disabled = !hasPending; + console.log('Clear pending button updated:', { disabled: !hasPending, hasPending }); + } else { + console.error('Clear pending button not found in DOM'); + } } async clearQueue(type) { const titles = { completed: 'Clear Completed Downloads', - failed: 'Clear Failed Downloads' + failed: 'Clear Failed Downloads', + pending: 'Remove All Pending Downloads' }; const messages = { completed: 'Are you sure you want to clear all completed downloads?', - failed: 'Are you sure you want to clear all failed downloads?' + failed: 'Are you sure you want to clear all failed downloads?', + pending: 'Are you sure you want to remove all pending downloads from the queue?' }; const confirmed = await this.showConfirmModal(titles[type], messages[type]); @@ -495,6 +518,16 @@ class QueueManager { this.showToast(`Cleared ${data.count} failed downloads`, 'success'); this.loadQueueData(); + } else if (type === 'pending') { + const response = await this.makeAuthenticatedRequest('/api/queue/pending', { + method: 'DELETE' + }); + + if (!response) return; + const data = await response.json(); + + this.showToast(`Removed ${data.count} pending downloads`, 'success'); + this.loadQueueData(); } } catch (error) { diff --git a/src/server/web/templates/queue.html b/src/server/web/templates/queue.html index 15a6885..6b90710 100644 --- a/src/server/web/templates/queue.html +++ b/src/server/web/templates/queue.html @@ -124,6 +124,10 @@ Download Queue (0)