summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-04-08 00:44:58 -0700
committerFuwn <[email protected]>2025-04-08 00:44:58 -0700
commit649c82689a0443da4a600bceeba473296ee356cd (patch)
tree6be7d0c4f005809dc204735e010b047d30e7c391
parentfeat: Development commit (diff)
downloadsora-testing-649c82689a0443da4a600bceeba473296ee356cd.tar.xz
sora-testing-649c82689a0443da4a600bceeba473296ee356cd.zip
feat: Development commit
-rw-r--r--Sora.xcodeproj/project.pbxproj17
-rw-r--r--Sora.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved11
-rw-r--r--Sora/Data/Booru/BooruManager.swift11
3 files changed, 37 insertions, 2 deletions
diff --git a/Sora.xcodeproj/project.pbxproj b/Sora.xcodeproj/project.pbxproj
index 7c10187..582202b 100644
--- a/Sora.xcodeproj/project.pbxproj
+++ b/Sora.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
4C67001D2D6EC75F00FFDC8D /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 4C67001C2D6EC75F00FFDC8D /* Localizable.xcstrings */; };
4CA3DE752D65B5990033035D /* WaterfallGrid in Frameworks */ = {isa = PBXBuildFile; productRef = 4CA3DE742D65B5990033035D /* WaterfallGrid */; };
4CBAE9322D6C8CAE00C02D46 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 4CBAE9312D6C8CAE00C02D46 /* Settings.bundle */; };
+ 4CDEC8DF2DA5087D00EB74FE /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 4CDEC8DE2DA5087D00EB74FE /* Alamofire */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -45,6 +46,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 4CDEC8DF2DA5087D00EB74FE /* Alamofire in Frameworks */,
4CA3DE752D65B5990033035D /* WaterfallGrid in Frameworks */,
4C334B072D6CC280002F5D8D /* NetworkImage in Frameworks */,
);
@@ -93,6 +95,7 @@
packageProductDependencies = (
4CA3DE742D65B5990033035D /* WaterfallGrid */,
4C334B062D6CC280002F5D8D /* NetworkImage */,
+ 4CDEC8DE2DA5087D00EB74FE /* Alamofire */,
);
productName = Sora;
productReference = 4CD342762D6341D900565E6F /* Sora.app */;
@@ -126,6 +129,7 @@
packageReferences = (
4CA3DE732D65B5990033035D /* XCRemoteSwiftPackageReference "WaterfallGrid" */,
4C334B052D6CC280002F5D8D /* XCRemoteSwiftPackageReference "NetworkImage" */,
+ 4CDEC8DD2DA5087D00EB74FE /* XCRemoteSwiftPackageReference "Alamofire" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 4CD342772D6341D900565E6F /* Products */;
@@ -398,6 +402,14 @@
minimumVersion = 1.1.0;
};
};
+ 4CDEC8DD2DA5087D00EB74FE /* XCRemoteSwiftPackageReference "Alamofire" */ = {
+ isa = XCRemoteSwiftPackageReference;
+ repositoryURL = "https://github.com/Alamofire/Alamofire";
+ requirement = {
+ kind = upToNextMajorVersion;
+ minimumVersion = 5.10.2;
+ };
+ };
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
@@ -411,6 +423,11 @@
package = 4CA3DE732D65B5990033035D /* XCRemoteSwiftPackageReference "WaterfallGrid" */;
productName = WaterfallGrid;
};
+ 4CDEC8DE2DA5087D00EB74FE /* Alamofire */ = {
+ isa = XCSwiftPackageProductDependency;
+ package = 4CDEC8DD2DA5087D00EB74FE /* XCRemoteSwiftPackageReference "Alamofire" */;
+ productName = Alamofire;
+ };
/* End XCSwiftPackageProductDependency section */
};
rootObject = 4CD3426E2D6341D900565E6F /* Project object */;
diff --git a/Sora.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Sora.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 397c815..d0f183e 100644
--- a/Sora.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/Sora.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -1,7 +1,16 @@
{
- "originHash" : "7b5b8123836b0bddd9d6a3cd5d1412cee34fcfdd0cfcc6af9e9b3c9db2b4c525",
+ "originHash" : "c50e09913d50aae8aa6f21a6cb611786d29d9b3056c935de95ffca5e7687ef91",
"pins" : [
{
+ "identity" : "alamofire",
+ "kind" : "remoteSourceControl",
+ "location" : "https://github.com/Alamofire/Alamofire",
+ "state" : {
+ "revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5",
+ "version" : "5.10.2"
+ }
+ },
+ {
"identity" : "networkimage",
"kind" : "remoteSourceControl",
"location" : "https://github.com/gonzalezreal/NetworkImage",
diff --git a/Sora/Data/Booru/BooruManager.swift b/Sora/Data/Booru/BooruManager.swift
index c57feee..8e9c5bd 100644
--- a/Sora/Data/Booru/BooruManager.swift
+++ b/Sora/Data/Booru/BooruManager.swift
@@ -1,3 +1,4 @@
+import Alamofire
import SwiftUI
@MainActor
@@ -93,7 +94,15 @@ class BooruManager: ObservableObject {
defer { isLoading = false }
do {
- let (data, _) = try await URLSession.shared.data(from: url)
+ let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0"
+ let buildNumber = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "1"
+
+ let data = try await AF.request(
+ url,
+ headers: ["User-Agent": "Sora/\(version) (Build \(buildNumber))"]
+ )
+ .serializingData()
+ .value
guard !Task.isCancelled else { return }