mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Merge branch 'main' into chore-linter-warnings
This commit is contained in:
@@ -47,7 +47,7 @@ extension PlayerModel {
|
||||
}
|
||||
|
||||
func updateWatch(finished: Bool = false, time: CMTime? = nil) {
|
||||
guard let currentVideo, saveHistory else { return }
|
||||
guard let currentVideo, saveHistory, isPlaying else { return }
|
||||
|
||||
let id = currentVideo.videoID
|
||||
let time = time ?? backend.currentTime
|
||||
|
@@ -464,8 +464,6 @@ final class MPVBackend: PlayerBackend {
|
||||
timeObserverThrottle.execute {
|
||||
self.model.updateWatch(time: self.currentTime)
|
||||
}
|
||||
|
||||
self.model.updateTime(self.currentTime!)
|
||||
}
|
||||
|
||||
private func stopClientUpdates() {
|
||||
|
@@ -20,21 +20,23 @@ final class ThumbnailsModel: ObservableObject {
|
||||
return unloadable.contains(url)
|
||||
}
|
||||
|
||||
func best(_ video: Video) -> URL? {
|
||||
func best(_ video: Video) -> (url: URL?, quality: Thumbnail.Quality?) {
|
||||
for quality in availableQualitites {
|
||||
let url = video.thumbnailURL(quality: quality)
|
||||
if !isUnloadable(url) {
|
||||
return url
|
||||
return (url, quality)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
return (nil, nil)
|
||||
}
|
||||
|
||||
private var availableQualitites: [Thumbnail.Quality] {
|
||||
switch Defaults[.thumbnailsQuality] {
|
||||
case .highest:
|
||||
return [.maxresdefault, .medium, .default]
|
||||
return [.maxres, .high, .medium, .default]
|
||||
case .high:
|
||||
return [.high, .medium, .default]
|
||||
case .medium:
|
||||
return [.medium, .default]
|
||||
case .low:
|
||||
|
Reference in New Issue
Block a user