Use cache for loading player queue and history

This commit is contained in:
Arkadiusz Fal
2022-12-13 00:38:26 +01:00
parent 33a131d2ca
commit 1c746bc8e0
11 changed files with 66 additions and 53 deletions

View File

@@ -1,8 +1,6 @@
import SwiftUI
struct HistoryView: View {
static let detailsPreloadLimit = 50
var limit = 10
@FetchRequest(sortDescriptors: [.init(key: "watchedAt", ascending: false)])
@@ -33,7 +31,6 @@ struct HistoryView: View {
}
.onAppear {
visibleWatches
.prefix(Self.detailsPreloadLimit)
.forEach(player.loadHistoryVideoDetails)
}
#if os(tvOS)

View File

@@ -86,9 +86,6 @@ struct PlayerQueueView: View {
ForEach(player.queue) { item in
PlayerQueueRow(item: item, fullScreen: $fullScreen)
.onAppear {
player.loadQueueVideoDetails(item)
}
.contextMenu {
removeButton(item)
removeAllButton()