mirror of
https://github.com/cranci1/Sora.git
synced 2026-01-11 20:10:24 +00:00
fixed nil case + error
This commit is contained in:
parent
44c5b59601
commit
4ce60d957d
2 changed files with 5 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue