1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-14 06:10:32 +05:30

Fix crash on unloadable history items

This commit is contained in:
Arkadiusz Fal 2022-06-29 23:57:42 +02:00
parent 5919aa1505
commit 925360ebd9

View File

@ -163,13 +163,15 @@ extension PlayerModel {
} }
func playHistory(_ item: PlayerQueueItem, at time: CMTime? = nil) { func playHistory(_ item: PlayerQueueItem, at time: CMTime? = nil) {
guard let video = item.video else { return }
var time = time ?? item.playbackTime var time = time ?? item.playbackTime
if item.shouldRestartPlaying { if item.shouldRestartPlaying {
time = .zero time = .zero
} }
let newItem = enqueueVideo(item.video, atTime: time, prepending: true) let newItem = enqueueVideo(video, atTime: time, prepending: true)
advanceToItem(newItem!) advanceToItem(newItem!)
} }