Problem
When users run a library scan and create encoding jobs, there's no check to skip files that already have an active or completed job. This leads to wasted processing and duplicate jobs.
Expected Behavior
Before creating a new job for a file, check if a job already exists with status COMPLETED, ENCODING, or QUEUED for that filePath. If so, skip creating a duplicate job.
Location
apps/backend/src/libraries/libraries.service.ts - createJobsFromScan() method
Additional Considerations
- Also check in queue.service.ts create() method for direct job creation
- Consider adding optional force parameter to override duplicate check
Problem
When users run a library scan and create encoding jobs, there's no check to skip files that already have an active or completed job. This leads to wasted processing and duplicate jobs.
Expected Behavior
Before creating a new job for a file, check if a job already exists with status COMPLETED, ENCODING, or QUEUED for that filePath. If so, skip creating a duplicate job.
Location
apps/backend/src/libraries/libraries.service.ts - createJobsFromScan() method
Additional Considerations