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:
@@ -5,6 +5,7 @@ struct PlaybackQueue {
|
||||
let id = UUID()
|
||||
let url: URL
|
||||
var label: String? = nil
|
||||
var metadataAttempted = false
|
||||
var displayName: String { label ?? url.lastPathComponent }
|
||||
}
|
||||
|
||||
@@ -31,9 +32,10 @@ struct PlaybackQueue {
|
||||
items.append(contentsOf: entries.map { Item(url: $0.url, label: $0.label) })
|
||||
}
|
||||
|
||||
mutating func updateCurrentLabel(_ label: String) {
|
||||
guard let index = currentIndex else { return }
|
||||
items[index].label = label
|
||||
mutating func updateLabel(_ label: String?, for id: UUID) {
|
||||
guard let index = items.firstIndex(where: { $0.id == id }) else { return }
|
||||
if let label { items[index].label = label }
|
||||
items[index].metadataAttempted = true
|
||||
}
|
||||
|
||||
mutating func append(_ urls: [URL]) {
|
||||
|
||||
Reference in New Issue
Block a user