diff --git a/Sora/Utils/Extensions/finTopView.swift b/Sora/Utils/Extensions/FindTopView.swift similarity index 100% rename from Sora/Utils/Extensions/finTopView.swift rename to Sora/Utils/Extensions/FindTopView.swift diff --git a/Sora/Utils/JSLoader/JSController-Explore.swift b/Sora/Utils/JSLoader/JSController-Explore.swift index 5e5a060..cf712e1 100644 --- a/Sora/Utils/JSLoader/JSController-Explore.swift +++ b/Sora/Utils/JSLoader/JSController-Explore.swift @@ -10,6 +10,7 @@ import JavaScriptCore // TODO: implement and test extension JSController { func fetchExploreResults(module: ScrapingModule, completion: @escaping ([ExploreItem]) -> Void) { + completion([]) /*let searchUrl = module.metadata.searchBaseUrl.replacingOccurrences(of: "%s", with: keyword.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? "") guard let url = URL(string: searchUrl) else { @@ -54,6 +55,7 @@ extension JSController { } func fetchJsExploreResults(module: ScrapingModule, completion: @escaping ([ExploreItem]) -> Void) { + completion([]) /* if let exception = context.exception { Logger.shared.log("JavaScript exception: \(exception)",type: "Error") diff --git a/Sora/Utils/ProfileStore/ProfileStore.swift b/Sora/Utils/ProfileStore/ProfileStore.swift index eb44025..52ec60b 100644 --- a/Sora/Utils/ProfileStore/ProfileStore.swift +++ b/Sora/Utils/ProfileStore/ProfileStore.swift @@ -75,8 +75,8 @@ class ProfileStore: ObservableObject { func deleteProfile(removalID: UUID?) { guard let removalID, - profiles.count == 1 - else { return } + profiles.count > 1 + else { return } if let suite = UserDefaults(suiteName: removalID.uuidString) { for key in suite.dictionaryRepresentation().keys { diff --git a/Sora/Views/ExploreView/ExploreView.swift b/Sora/Views/ExploreView/ExploreView.swift index 5969390..a849b05 100644 --- a/Sora/Views/ExploreView/ExploreView.swift +++ b/Sora/Views/ExploreView/ExploreView.swift @@ -99,20 +99,22 @@ struct ExploreView: View { .padding(.top) .padding() } else if hasNoResults { - VStack(spacing: 8) { - Image(systemName: "star") - .font(.largeTitle) - .foregroundColor(.secondary) - .accessibilityLabel("Star Icon") - Text("No Content Available") - .font(.headline) - Text("Try updating the Module") - .font(.caption) - .foregroundColor(.secondary) + if !(hideEmptySections ?? false) { + VStack(spacing: 8) { + Image(systemName: "star") + .font(.largeTitle) + .foregroundColor(.secondary) + .accessibilityLabel("Star Icon") + Text("No Content Available") + .font(.headline) + Text("Try updating the Module") + .font(.caption) + .foregroundColor(.secondary) + } + .padding() + .frame(maxWidth: .infinity) + .padding(.top) } - .padding() - .frame(maxWidth: .infinity) - .padding(.top) } else { LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 16), count: columnsCount), spacing: 16) { ForEach(exploreItems) { item in @@ -161,6 +163,12 @@ struct ExploreView: View { } .navigationTitle("Explore") .navigationBarTitleDisplayMode(.large) + .refreshable { + await withCheckedContinuation { continuation in + fetchData() + continuation.resume() + } + } .toolbar { ToolbarItem(placement: .navigationBarLeading) { Menu { diff --git a/Sora/Views/SearchView/SearchView.swift b/Sora/Views/SearchView/SearchView.swift index 3f537ee..eb22506 100644 --- a/Sora/Views/SearchView/SearchView.swift +++ b/Sora/Views/SearchView/SearchView.swift @@ -118,20 +118,22 @@ struct SearchView: View { .padding(.top) .padding() } else if hasNoResults { - VStack(spacing: 8) { - Image(systemName: "magnifyingglass") - .font(.largeTitle) - .foregroundColor(.secondary) - .accessibilityLabel("Magnifying Glass Icon") - Text("No Results Found") - .font(.headline) - Text("Try different keywords") - .font(.caption) - .foregroundColor(.secondary) + if !(hideEmptySections ?? false) { + VStack(spacing: 8) { + Image(systemName: "magnifyingglass") + .font(.largeTitle) + .foregroundColor(.secondary) + .accessibilityLabel("Magnifying Glass Icon") + Text("No Results Found") + .font(.headline) + Text("Try different keywords") + .font(.caption) + .foregroundColor(.secondary) + } + .padding() + .frame(maxWidth: .infinity) + .padding(.top) } - .padding() - .frame(maxWidth: .infinity) - .padding(.top) } else { LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 16), count: columnsCount), spacing: 16) { ForEach(searchItems) { item in diff --git a/Sora/Views/SettingsView/SettingsView.swift b/Sora/Views/SettingsView/SettingsView.swift index 73ef05c..ad2f34e 100644 --- a/Sora/Views/SettingsView/SettingsView.swift +++ b/Sora/Views/SettingsView/SettingsView.swift @@ -178,10 +178,12 @@ class Settings: ObservableObject { } private func applyColorToUIKit(_ color: Color) { + let newColor = UIColor(color) let tempStepper = UIStepper() - tempStepper.tintColor = UIColor(color) + tempStepper.tintColor = newColor UIStepper.appearance().setDecrementImage(tempStepper.decrementImage(for: .normal), for: .normal) UIStepper.appearance().setIncrementImage(tempStepper.incrementImage(for: .normal), for: .normal) + UIRefreshControl.appearance().tintColor = newColor } private func saveAccentColor(_ color: Color) { diff --git a/Sulfur.xcodeproj/project.pbxproj b/Sulfur.xcodeproj/project.pbxproj index 8215f45..8233065 100644 --- a/Sulfur.xcodeproj/project.pbxproj +++ b/Sulfur.xcodeproj/project.pbxproj @@ -9,10 +9,12 @@ /* Begin PBXBuildFile section */ 120D3C722DBA40AB0093D596 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = 120D3C712DBA40A40093D596 /* .swiftlint.yml */; }; 120D3C732DBA40AB0093D596 /* .swiftlint.yml in Resources */ = {isa = PBXBuildFile; fileRef = 120D3C712DBA40A40093D596 /* .swiftlint.yml */; }; + 1258EA372DC4404F009B8D12 /* Drops in Frameworks */ = {isa = PBXBuildFile; productRef = 1258EA362DC4404F009B8D12 /* Drops */; }; + 1258EA392DC4404F009B8D12 /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 1258EA382DC4404F009B8D12 /* Kingfisher */; }; + 1258EA3B2DC4404F009B8D12 /* MarqueeLabel in Frameworks */ = {isa = PBXBuildFile; productRef = 1258EA3A2DC4404F009B8D12 /* MarqueeLabel */; }; 126C428D2DB99627006BC27D /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 126C428C2DB99627006BC27D /* Localizable.xcstrings */; }; 126C428E2DB99627006BC27D /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 126C428C2DB99627006BC27D /* Localizable.xcstrings */; }; 132E351D2D959DDB0007800E /* Drops in Frameworks */ = {isa = PBXBuildFile; productRef = 132E351C2D959DDB0007800E /* Drops */; }; - 132E35202D959E1D0007800E /* FFmpeg-iOS-Lame in Frameworks */ = {isa = PBXBuildFile; productRef = 132E351F2D959E1D0007800E /* FFmpeg-iOS-Lame */; }; 132E35232D959E410007800E /* Kingfisher in Frameworks */ = {isa = PBXBuildFile; productRef = 132E35222D959E410007800E /* Kingfisher */; }; 13B77E192DA44F8300126FDF /* MarqueeLabel in Frameworks */ = {isa = PBXBuildFile; productRef = 13B77E182DA44F8300126FDF /* MarqueeLabel */; }; /* End PBXBuildFile section */ @@ -51,6 +53,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1258EA392DC4404F009B8D12 /* Kingfisher in Frameworks */, + 1258EA372DC4404F009B8D12 /* Drops in Frameworks */, + 1258EA3B2DC4404F009B8D12 /* MarqueeLabel in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -60,7 +65,6 @@ files = ( 13B77E192DA44F8300126FDF /* MarqueeLabel in Frameworks */, 132E35232D959E410007800E /* Kingfisher in Frameworks */, - 132E35202D959E1D0007800E /* FFmpeg-iOS-Lame in Frameworks */, 132E351D2D959DDB0007800E /* Drops in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -109,6 +113,9 @@ ); name = SulfurTV; packageProductDependencies = ( + 1258EA362DC4404F009B8D12 /* Drops */, + 1258EA382DC4404F009B8D12 /* Kingfisher */, + 1258EA3A2DC4404F009B8D12 /* MarqueeLabel */, ); productName = SulfurTV; productReference = 120764652DB6F6E0003621E9 /* SulfurTV.app */; @@ -133,7 +140,6 @@ name = Sulfur; packageProductDependencies = ( 132E351C2D959DDB0007800E /* Drops */, - 132E351F2D959E1D0007800E /* FFmpeg-iOS-Lame */, 132E35222D959E410007800E /* Kingfisher */, 13B77E182DA44F8300126FDF /* MarqueeLabel */, ); @@ -170,7 +176,6 @@ mainGroup = 133D7C612D2BE2500075467E; packageReferences = ( 132E351B2D959DDB0007800E /* XCRemoteSwiftPackageReference "Drops" */, - 132E351E2D959E1D0007800E /* XCRemoteSwiftPackageReference "FFmpeg-iOS-Lame" */, 132E35212D959E410007800E /* XCRemoteSwiftPackageReference "Kingfisher" */, 13B77E172DA44F8300126FDF /* XCRemoteSwiftPackageReference "MarqueeLabel" */, 123FEDD22DC412F0001C4704 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */, @@ -572,8 +577,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 0.59.1; + branch = main; + kind = branch; }; }; 132E351B2D959DDB0007800E /* XCRemoteSwiftPackageReference "Drops" */ = { @@ -584,14 +589,6 @@ kind = branch; }; }; - 132E351E2D959E1D0007800E /* XCRemoteSwiftPackageReference "FFmpeg-iOS-Lame" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/kewlbear/FFmpeg-iOS-Lame"; - requirement = { - branch = main; - kind = branch; - }; - }; 132E35212D959E410007800E /* XCRemoteSwiftPackageReference "Kingfisher" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/onevcat/Kingfisher.git"; @@ -621,15 +618,25 @@ package = 123FEDD22DC412F0001C4704 /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */; productName = "plugin:SwiftLintBuildToolPlugin"; }; - 132E351C2D959DDB0007800E /* Drops */ = { + 1258EA362DC4404F009B8D12 /* Drops */ = { isa = XCSwiftPackageProductDependency; package = 132E351B2D959DDB0007800E /* XCRemoteSwiftPackageReference "Drops" */; productName = Drops; }; - 132E351F2D959E1D0007800E /* FFmpeg-iOS-Lame */ = { + 1258EA382DC4404F009B8D12 /* Kingfisher */ = { isa = XCSwiftPackageProductDependency; - package = 132E351E2D959E1D0007800E /* XCRemoteSwiftPackageReference "FFmpeg-iOS-Lame" */; - productName = "FFmpeg-iOS-Lame"; + package = 132E35212D959E410007800E /* XCRemoteSwiftPackageReference "Kingfisher" */; + productName = Kingfisher; + }; + 1258EA3A2DC4404F009B8D12 /* MarqueeLabel */ = { + isa = XCSwiftPackageProductDependency; + package = 13B77E172DA44F8300126FDF /* XCRemoteSwiftPackageReference "MarqueeLabel" */; + productName = MarqueeLabel; + }; + 132E351C2D959DDB0007800E /* Drops */ = { + isa = XCSwiftPackageProductDependency; + package = 132E351B2D959DDB0007800E /* XCRemoteSwiftPackageReference "Drops" */; + productName = Drops; }; 132E35222D959E410007800E /* Kingfisher */ = { isa = XCSwiftPackageProductDependency; diff --git a/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 55034eb..d3e4d70 100644 --- a/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Sulfur.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "c4909124df3eb22bfcc539fb1f3936eb79c309605d2f34c5b02efa1fe3f48447", + "originHash" : "201a3201a2876c1cee578165a829a39bb460fe178ce209055cc70e0c28d43134", "pins" : [ { "identity" : "drops", @@ -10,24 +10,6 @@ "revision" : "5824681795286c36bdc4a493081a63e64e2a064e" } }, - { - "identity" : "ffmpeg-ios-lame", - "kind" : "remoteSourceControl", - "location" : "https://github.com/kewlbear/FFmpeg-iOS-Lame", - "state" : { - "branch" : "main", - "revision" : "1808fa5a1263c5e216646cd8421fc7dcb70520cc" - } - }, - { - "identity" : "ffmpeg-ios-support", - "kind" : "remoteSourceControl", - "location" : "https://github.com/kewlbear/FFmpeg-iOS-Support", - "state" : { - "revision" : "be3bd9149ac53760e8725652eee99c405b2be47a", - "version" : "0.0.2" - } - }, { "identity" : "kingfisher", "kind" : "remoteSourceControl", @@ -51,8 +33,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/SimplyDanny/SwiftLintPlugins", "state" : { - "revision" : "8545ddf4de043e6f2051c5cf204f39ef778ebf6b", - "version" : "0.59.1" + "branch" : "main", + "revision" : "8545ddf4de043e6f2051c5cf204f39ef778ebf6b" } } ],