refactor(api): register each route once and merge duplicated handler code

Swagger now owns route registration instead of adding a second dead copy of every route; add json_body, enqueue_job, serialize_tracks and client_credential, build the serve middleware list once, and scan the users once per request.
This commit is contained in:
imSp4rky
2026-11-02 15:06:52 -07:00
parent 47d9e3d3c9
commit e685710fba
6 changed files with 144 additions and 283 deletions
+1 -1
View File
@@ -913,7 +913,7 @@ class DownloadQueueManager:
jobs_to_remove = []
for job_id, job in self._jobs.items():
if job.status in [JobStatus.COMPLETED, JobStatus.FAILED, JobStatus.CANCELLED]:
if job.status in TERMINAL_STATUSES:
if job.completed_time and job.completed_time < cutoff_time:
jobs_to_remove.append(job_id)
elif not job.completed_time and job.created_time < cutoff_time: