Videos cache model

This commit is contained in:
Arkadiusz Fal
2022-12-10 01:23:13 +01:00
parent 0c960c2461
commit 64146b26c2
12 changed files with 204 additions and 9 deletions

View File

@@ -87,7 +87,7 @@ extension PlayerModel {
}
func playerAPI(_ video: Video) -> VideosAPI! {
guard let url = video.instanceURL else { return nil }
guard let url = video.instanceURL else { return accounts.api }
switch video.app {
case .local:
return nil

View File

@@ -34,6 +34,7 @@ extension PlayerModel {
.load()
.onSuccess { response in
if let video: Video = response.typedContent() {
VideosCacheModel.shared.storeVideo(video)
guard video.videoID == self.currentVideo?.videoID else {
self.logger.info("ignoring loaded streams from \(instance.description) as current video has changed")
return