From 3cf264fab80b8ce49f31d1f1e3d1f727b01b1bd6 Mon Sep 17 00:00:00 2001 From: 50/50 <80717571+50n50@users.noreply.github.com> Date: Sun, 1 Jun 2025 18:54:07 +0200 Subject: [PATCH] action button for movies (#145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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> --- Sora/Views/MediaInfoView/MediaInfoView.swift | 26 ++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Sora/Views/MediaInfoView/MediaInfoView.swift b/Sora/Views/MediaInfoView/MediaInfoView.swift index c522f3b..b1c626d 100644 --- a/Sora/Views/MediaInfoView/MediaInfoView.swift +++ b/Sora/Views/MediaInfoView/MediaInfoView.swift @@ -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)