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
+5 -3
View File
@@ -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]) {