mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
Add options for history: badge color and reset watched status on playing
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import CoreData
|
||||
import CoreMedia
|
||||
import Defaults
|
||||
import Foundation
|
||||
|
||||
extension PlayerModel {
|
||||
@@ -42,6 +43,10 @@ extension PlayerModel {
|
||||
watch.videoID = id
|
||||
} else {
|
||||
watch = results?.first
|
||||
|
||||
if !Defaults[.resetWatchedStatusOnPlaying], watch.finished {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if let seconds = playerItemDuration?.seconds {
|
||||
|
@@ -24,6 +24,11 @@ extension Watch {
|
||||
}
|
||||
|
||||
let progress = (stoppedAt / videoDuration) * 100
|
||||
|
||||
if progress >= Double(watchedThreshold) {
|
||||
return 100
|
||||
}
|
||||
|
||||
return min(max(progress, 0), 100)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user