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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user