mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix player controls progress bar
This commit is contained in:
parent
7317aec1ed
commit
c1e219e46e
@ -27,7 +27,9 @@ extension PlayerModel {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let time = player.currentTime().seconds
|
let time = player.currentTime()
|
||||||
|
let seconds = time.seconds
|
||||||
|
currentItem.playbackTime = time
|
||||||
|
|
||||||
let watch: Watch!
|
let watch: Watch!
|
||||||
let watchFetchRequest = Watch.fetchRequest()
|
let watchFetchRequest = Watch.fetchRequest()
|
||||||
@ -36,7 +38,7 @@ extension PlayerModel {
|
|||||||
let results = try? context.fetch(watchFetchRequest)
|
let results = try? context.fetch(watchFetchRequest)
|
||||||
|
|
||||||
if results?.isEmpty ?? true {
|
if results?.isEmpty ?? true {
|
||||||
if time < 1 {
|
if seconds < 1 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
watch = Watch(context: context)
|
watch = Watch(context: context)
|
||||||
@ -55,8 +57,8 @@ extension PlayerModel {
|
|||||||
|
|
||||||
if finished {
|
if finished {
|
||||||
watch.stoppedAt = watch.videoDuration
|
watch.stoppedAt = watch.videoDuration
|
||||||
} else if time.isFinite, time > 0 {
|
} else if seconds.isFinite, seconds > 0 {
|
||||||
watch.stoppedAt = time
|
watch.stoppedAt = seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
watch.watchedAt = Date()
|
watch.watchedAt = Date()
|
||||||
|
Loading…
Reference in New Issue
Block a user