fix: resolve queued stream metadata in the background

Queue labels were only enriched through selected-entry playback. Resolve unplayed titles serially at utility priority, preempt enrichment for playback, and bind updates to queue item IDs.

Verified: make check-resolved check-queue check-youtube all.
This commit is contained in:
2026-10-22 18:01:07 +02:00
parent f1339050d9
commit 6ed7db8167
7 changed files with 207 additions and 18 deletions
+4 -1
View File
@@ -312,7 +312,7 @@ private struct YouTubeExtractionOutput: Sendable {
// All Process, pipe, and continuation state belongs to this request's serial queue.
private final class YouTubeExtraction: @unchecked Sendable {
private let queue = DispatchQueue(label: "terebi.youtube-extraction", qos: .userInitiated)
private let queue: DispatchQueue
private let process = Process()
private let stdoutPipe = Pipe()
private let stderrPipe = Pipe()
@@ -331,6 +331,9 @@ private final class YouTubeExtraction: @unchecked Sendable {
private var failure: (any Error)?
init(executable: URL, arguments: [String], environment: [String: String]) {
let background = Task.currentPriority <= .utility
queue = DispatchQueue(label: "terebi.youtube-extraction", qos: background ? .utility : .userInitiated)
process.qualityOfService = background ? .utility : .userInitiated
process.executableURL = executable
process.arguments = arguments
process.environment = environment