Better UI handling for loading video details (fixes #46)

This commit is contained in:
Arkadiusz Fal
2021-12-29 19:55:41 +01:00
parent 0af2db2fd7
commit 89957e3b56
4 changed files with 82 additions and 19 deletions

View File

@@ -43,6 +43,10 @@ extension PlayerModel {
.load()
.onSuccess { response in
if let video: Video = response.typedContent() {
guard video == self.currentVideo else {
self.logger.info("ignoring loaded streams from \(instance.description) as current video has changed")
return
}
self.availableStreams += self.streamsWithInstance(instance: instance, streams: video.streams)
} else {
self.logger.critical("no streams available from \(instance.description)")