mirror of
https://github.com/cranci1/Sora.git
synced 2026-04-13 04:50:41 +00:00
action button for movies (#145)
* Minor changes * more minor changes * MORE MINOR CHANGES * Fixed one singular bug * Update SettingsViewGeneral.swift * fuck conflicts * fuck you and your credits * buh buh * Update SettingsViewAbout.swift * What's that? What's a properly working code without unnecessary issues? * Type shit maybe? * Create ios.yml * smol * type shi shi * end * Fixed system theme bug * (hopefully) fixed sliding items in search + recent searches spam * Fixed open keyboard in media view * Fixed searchviewdata + fixed toggle color being too light * fixed episode slider sensitivity * new recent searches, not fully done but wtv WHO CARES 💯 * Add module screen fix * Delete .github/workflows/ios.yml * UI modifications * Scroll to close keyboard * Text change * Downloadview transition * Search cards text fixed * Reduced header spacing + moved down a to match library * Text change * Small tab bar tweak for search view * added gradient to player buttons * reduced summary size * IBH special 💯 * Fixed different height text? * Removed seperator * Some more fixes start watching button * MediaInfoView modifications * Fixed settingsviewdata * Changed x mark and fixed episode swipe for 4 items * Delete Package.resolved * fix * fix * Update Package.resolved * Removed version lalel type shi * Who thought this view existed? 😭 * Less wide tab bar * Actions button for movies + resetting watch progress --------- Co-authored-by: cranci <100066266+cranci1@users.noreply.github.com>
This commit is contained in:
parent
e0a8d46fdb
commit
3cf264fab8
1 changed files with 24 additions and 2 deletions
|
|
@ -354,13 +354,33 @@ struct MediaInfoView: View {
|
|||
UserDefaults.standard.set(99999999.0, forKey: "lastPlayedTime_\(ep.href)")
|
||||
UserDefaults.standard.set(99999999.0, forKey: "totalTime_\(ep.href)")
|
||||
DropManager.shared.showDrop(title: "Marked as Watched", subtitle: "", duration: 1.0, icon: UIImage(systemName: "checkmark.circle.fill"))
|
||||
} else {
|
||||
UserDefaults.standard.set(0.0, forKey: "lastPlayedTime_\(ep.href)")
|
||||
UserDefaults.standard.set(0.0, forKey: "totalTime_\(ep.href)")
|
||||
DropManager.shared.showDrop(title: "Progress Reset", subtitle: "", duration: 1.0, icon: UIImage(systemName: "arrow.counterclockwise"))
|
||||
}
|
||||
}
|
||||
}) {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "checkmark.circle")
|
||||
Image(systemName: {
|
||||
if let ep = episodeLinks.first {
|
||||
let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(ep.href)")
|
||||
let totalTime = UserDefaults.standard.double(forKey: "totalTime_\(ep.href)")
|
||||
let progress = totalTime > 0 ? lastPlayedTime / totalTime : 0
|
||||
return progress <= 0.9 ? "checkmark.circle" : "arrow.counterclockwise"
|
||||
}
|
||||
return "checkmark.circle"
|
||||
}())
|
||||
.foregroundColor(.primary)
|
||||
Text("Mark as Watched")
|
||||
Text({
|
||||
if let ep = episodeLinks.first {
|
||||
let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(ep.href)")
|
||||
let totalTime = UserDefaults.standard.double(forKey: "totalTime_\(ep.href)")
|
||||
let progress = totalTime > 0 ? lastPlayedTime / totalTime : 0
|
||||
return progress <= 0.9 ? "Mark as watched" : "Reset progress"
|
||||
}
|
||||
return "Mark as watched"
|
||||
}())
|
||||
.font(.system(size: 14, weight: .medium))
|
||||
.foregroundColor(.primary)
|
||||
}
|
||||
|
|
@ -401,6 +421,8 @@ struct MediaInfoView: View {
|
|||
.cornerRadius(15)
|
||||
.gradientOutline()
|
||||
}
|
||||
|
||||
menuButton
|
||||
}
|
||||
Text("Why am I not seeing any episodes?")
|
||||
.font(.caption)
|
||||
|
|
|
|||
Loading…
Reference in a new issue