diff --git a/Sora/MediaUtils/CustomPlayer/CustomPlayer.swift b/Sora/MediaUtils/CustomPlayer/CustomPlayer.swift index 789b378..131d0cc 100644 --- a/Sora/MediaUtils/CustomPlayer/CustomPlayer.swift +++ b/Sora/MediaUtils/CustomPlayer/CustomPlayer.swift @@ -1592,6 +1592,7 @@ class CustomMediaPlayerViewController: UIViewController, UIGestureRecognizerDele self.updateSkipButtonsVisibility() + Logger.shared.log(fullUrl, type: "Stream") UserDefaults.standard.set(self.currentTimeVal, forKey: "lastPlayedTime_\(self.fullUrl)") UserDefaults.standard.set(self.duration, forKey: "totalTime_\(self.fullUrl)") diff --git a/Sora/MediaUtils/NormalPlayer/VideoPlayer.swift b/Sora/MediaUtils/NormalPlayer/VideoPlayer.swift index 4810e4a..141d38c 100644 --- a/Sora/MediaUtils/NormalPlayer/VideoPlayer.swift +++ b/Sora/MediaUtils/NormalPlayer/VideoPlayer.swift @@ -90,6 +90,7 @@ class VideoPlayerViewController: UIViewController { } addPeriodicTimeObserver(fullURL: fullUrl) + Logger.shared.log(fullUrl, type: "Stream") let lastPlayedTime = UserDefaults.standard.double(forKey: "lastPlayedTime_\(fullUrl)") if lastPlayedTime > 0 { let seekTime = CMTime(seconds: lastPlayedTime, preferredTimescale: 1) @@ -208,7 +209,6 @@ class VideoPlayerViewController: UIViewController { override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - // Only start normal playback if not launched from SharePlay if !isLaunchedFromSharePlay { player?.play() setInitialPlayerRate() @@ -217,7 +217,6 @@ class VideoPlayerViewController: UIViewController { await checkForFaceTimeAndPromptSharePlay() } } else { - // For SharePlay launches, the playback will be coordinated setInitialPlayerRate() } } diff --git a/Sora/Utils/Extensions/URLSession.swift b/Sora/Utils/Extensions/URLSession.swift index d1cacb7..63beafd 100644 --- a/Sora/Utils/Extensions/URLSession.swift +++ b/Sora/Utils/Extensions/URLSession.swift @@ -5,8 +5,8 @@ // Created by Francesco on 05/01/25. // -import Foundation import Network +import Foundation class FetchDelegate: NSObject, URLSessionTaskDelegate { private let allowRedirects: Bool diff --git a/Sora/Utils/Modules/ModuleAdditionSettingsView.swift b/Sora/Utils/Modules/ModuleAdditionSettingsView.swift index 2398ca2..0c75830 100644 --- a/Sora/Utils/Modules/ModuleAdditionSettingsView.swift +++ b/Sora/Utils/Modules/ModuleAdditionSettingsView.swift @@ -87,7 +87,7 @@ struct ModuleAdditionSettingsView: View { .fill(Color(.systemGray5)) } } - .frame(width: 32, height: 32) + .frame(width: 40, height: 40) .clipShape(Circle()) .shadow( color: colorScheme == .dark diff --git a/Sora/Views/LibraryView/AllBookmarks.swift b/Sora/Views/LibraryView/AllBookmarks.swift index fa9aeda..cb4fde4 100644 --- a/Sora/Views/LibraryView/AllBookmarks.swift +++ b/Sora/Views/LibraryView/AllBookmarks.swift @@ -125,7 +125,6 @@ struct AllBookmarks: View { } Button(action: { if isSelecting { - // If trash icon tapped if !selectedBookmarks.isEmpty { for id in selectedBookmarks { if let item = libraryManager.bookmarks.first(where: { $0.id == id }) { diff --git a/Sora/Views/LibraryView/AllWatching.swift b/Sora/Views/LibraryView/AllWatching.swift index 558facd..c60a711 100644 --- a/Sora/Views/LibraryView/AllWatching.swift +++ b/Sora/Views/LibraryView/AllWatching.swift @@ -266,12 +266,17 @@ struct AllWatchingView: View { UserDefaults.standard.set(99999999.0, forKey: key) UserDefaults.standard.set(99999999.0, forKey: totalKey) ContinueWatchingManager.shared.remove(item: item) - loadContinueWatchingItems() + + DispatchQueue.main.async { + loadContinueWatchingItems() + } } private func removeItem(item: ContinueWatchingItem) { ContinueWatchingManager.shared.remove(item: item) - loadContinueWatchingItems() + DispatchQueue.main.async { + loadContinueWatchingItems() + } } } diff --git a/Sora/Views/MediaInfoView/MediaInfoView.swift b/Sora/Views/MediaInfoView/MediaInfoView.swift index 6546621..a4d053d 100644 --- a/Sora/Views/MediaInfoView/MediaInfoView.swift +++ b/Sora/Views/MediaInfoView/MediaInfoView.swift @@ -1508,7 +1508,7 @@ struct MediaInfoView: View { alert.addAction(UIAlertAction(title: title, style: .default) { _ in guard self.activeFetchID == fetchID else { return } - self.playStream(url: streamUrl, fullURL: href, subtitles: subtitles, headers: headers, fetchID: fetchID) + self.playStream(url: streamUrl, fullURL: fullURL, subtitles: subtitles, headers: headers, fetchID: fetchID) }) streamIndex += 1 @@ -1528,6 +1528,7 @@ struct MediaInfoView: View { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { guard self.activeFetchID == fetchID else { return } + Logger.shared.log(fullURL, type: "Stream") let externalPlayer = UserDefaults.standard.string(forKey: "externalPlayer") ?? "Sora" var scheme: String? diff --git a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewPlayer.swift b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewPlayer.swift index 468c17f..6aba3dc 100644 --- a/Sora/Views/SettingsView/SettingsSubViews/SettingsViewPlayer.swift +++ b/Sora/Views/SettingsView/SettingsSubViews/SettingsViewPlayer.swift @@ -378,7 +378,7 @@ struct SubtitleSettingsSection: View { icon: "captions.bubble", title: NSLocalizedString("Enable Subtitles", comment: ""), isOn: $subtitlesEnabled, - showDivider: false + showDivider: true ) .onChange(of: subtitlesEnabled) { newValue in SubtitleSettingsManager.shared.update { settings in @@ -454,4 +454,4 @@ struct SubtitleSettingsSection: View { } } } -} \ No newline at end of file +}