fixed nil case + error

This commit is contained in:
cranci1 2025-06-25 10:37:09 +02:00
parent 44c5b59601
commit 4ce60d957d
2 changed files with 5 additions and 3 deletions

View file

@ -1642,8 +1642,9 @@ class CustomMediaPlayerViewController: UIViewController, UIGestureRecognizerDele
ContinueWatchingManager.shared.save(item: item)
}
let remainingPercentage = (duration - currentTime) / duration
let threshold = (100.0 - (UserDefaults.standard.double(forKey: "remainingTimePercentage"))) / 100.0 ?? 0.1
let remainingPercentage = (self.duration - self.currentTimeVal) / self.duration
let remainingTimePercentage = UserDefaults.standard.object(forKey: "remainingTimePercentage") != nil ? UserDefaults.standard.double(forKey: "remainingTimePercentage") : 90.0
let threshold = (100.0 - remainingTimePercentage) / 100.0
if remainingPercentage < threshold {
if self.aniListID != 0 && !self.aniListUpdatedSuccessfully && !self.aniListUpdateImpossible {

View file

@ -320,7 +320,8 @@ class VideoPlayerViewController: UIViewController {
}
let remainingPercentage = (duration - currentTime) / duration
let threshold = (100.0 - (UserDefaults.standard.double(forKey: "remainingTimePercentage"))) / 100.0 ?? 0.1
let remainingTimePercentage = UserDefaults.standard.object(forKey: "remainingTimePercentage") != nil ? UserDefaults.standard.double(forKey: "remainingTimePercentage") : 90.0
let threshold = (100.0 - remainingTimePercentage) / 100.0
if remainingPercentage < threshold {
if self.aniListID != 0 && !self.aniListUpdateSent {