From fa3b53491f3bff431d2b5d0b66b94e9e9bc7f7c2 Mon Sep 17 00:00:00 2001 From: xjbeta Date: Tue, 15 Aug 2023 18:53:48 +0800 Subject: [PATCH 1/7] remove cartfile --- Cartfile.resolved | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 Cartfile.resolved diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index 27a33ac..0000000 --- a/Cartfile.resolved +++ /dev/null @@ -1,4 +0,0 @@ -github "PromiseKit/Foundation" "3.3.4" -github "daltoniam/Starscream" "4.0.4" -github "mxcl/PromiseKit" "6.13.3" -github "sparkle-project/Sparkle" "v1.23.0" From e27d77d482eb2f3153574ab43c7a0f8462fd212a Mon Sep 17 00:00:00 2001 From: xjbeta Date: Tue, 15 Aug 2023 18:53:55 +0800 Subject: [PATCH 2/7] fix decoder --- Aria2D/Views/ServerListArrayController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Aria2D/Views/ServerListArrayController.swift b/Aria2D/Views/ServerListArrayController.swift index 05fbf8f..9c8def2 100644 --- a/Aria2D/Views/ServerListArrayController.swift +++ b/Aria2D/Views/ServerListArrayController.swift @@ -198,7 +198,7 @@ struct Aria2Servers { required init?(coder aDecoder: NSCoder) { self.contents = aDecoder.decodeObject(forKey: "contents") as? [Aria2ConnectionSettings] ?? [] self.selectedID = aDecoder.decodeObject(forKey: "selectedID") as? String ?? "" - self.selectedIndex = aDecoder.decodeObject(forKey: "selectedIndex") as? Int ?? 0 + self.selectedIndex = aDecoder.decodeInteger(forKey: "selectedIndex") } func encode(with aCoder: NSCoder) { From 0f509fd3e5ea223ca2192ad6b751bca8938a7a67 Mon Sep 17 00:00:00 2001 From: xjbeta Date: Tue, 15 Aug 2023 19:35:15 +0800 Subject: [PATCH 3/7] fix onDownloadStart --- Aria2D/Aria2/Aria2Websocket.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Aria2D/Aria2/Aria2Websocket.swift b/Aria2D/Aria2/Aria2Websocket.swift index c2a0a94..db9be20 100644 --- a/Aria2D/Aria2/Aria2Websocket.swift +++ b/Aria2D/Aria2/Aria2Websocket.swift @@ -284,9 +284,7 @@ extension Aria2Websocket: WebSocketDelegate { let gids = json.params.map { $0.gid } switch json.method { case .onDownloadStart: - gids.forEach { - Aria2.shared.initData($0) - } + Aria2.shared.updateStatus(gids) ViewControllersManager.shared.showHUD(.downloadStart) case .onDownloadPause: Aria2.shared.updateStatus(gids) From db75b62032f0061383ec2ea6d96da19a2f3c0aa5 Mon Sep 17 00:00:00 2001 From: xjbeta Date: Tue, 15 Aug 2023 19:35:32 +0800 Subject: [PATCH 4/7] fix dock download speed --- Aria2D/Aria2/Aria2.swift | 11 +++++++++++ Aria2D/Views/Sidebar/SidebarViewController.swift | 3 +++ 2 files changed, 14 insertions(+) diff --git a/Aria2D/Aria2/Aria2.swift b/Aria2D/Aria2/Aria2.swift index dfbe5d6..fb01ed4 100644 --- a/Aria2D/Aria2/Aria2.swift +++ b/Aria2D/Aria2/Aria2.swift @@ -72,6 +72,17 @@ class Aria2: NSObject { } let re = try JSONDecoder().decode(GIDList.self, from: data).result.flatMap ({ $0 }).flatMap ({ $0 }) + + let actives = re.filter { + $0.contains(where: { + $0.value == Status.active.string() + }) + } + + if actives.count == 0 { + NotificationCenter.default.post(name: .updateGlobalStat, object: nil, userInfo: ["updateServer": true]) + } + try DataManager.shared.sortAllObjects(re) }.catch { Log("\(#function) error \($0)") diff --git a/Aria2D/Views/Sidebar/SidebarViewController.swift b/Aria2D/Views/Sidebar/SidebarViewController.swift index 5551dc3..6b58eff 100644 --- a/Aria2D/Views/Sidebar/SidebarViewController.swift +++ b/Aria2D/Views/Sidebar/SidebarViewController.swift @@ -134,6 +134,9 @@ class SidebarViewController: NSViewController { if isConnected, let activeCount = try? DataManager.shared.activeCount(), activeCount == 0 { + + dockTile.badgeLabel = "" + dockTile.badgeLabel = nil globalSpeedView.isHidden = true } } From 2d2c84cda3b47904dccb9a420253257d7e120fcb Mon Sep 17 00:00:00 2001 From: xjbeta Date: Tue, 15 Aug 2023 19:39:12 +0800 Subject: [PATCH 5/7] SPM --- .../xcshareddata/swiftpm/Package.resolved | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Aria2D.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Aria2D.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2bad467..c15ccf2 100644 --- a/Aria2D.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Aria2D.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/mxcl/PromiseKit", "state" : { - "revision" : "ed3192004c0b00b4b3d7baa9578ee655c66faae3", - "version" : "6.18.0" + "revision" : "8a98e31a47854d3180882c8068cc4d9381bf382d", + "version" : "6.22.1" } }, { @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/sparkle-project/Sparkle", "state" : { - "revision" : "059ce9128775d5a636c7f4716f71a58919d3111e", - "version" : "2.2.1" + "revision" : "87e4fcbac39912f9cdb9a9acf205cad60e1ca3bc", + "version" : "2.4.2" } }, { From 1c9d9e0c163ed51c8bdcad9b1a2acfdb79b77171 Mon Sep 17 00:00:00 2001 From: xjbeta Date: Tue, 15 Aug 2023 19:39:21 +0800 Subject: [PATCH 6/7] Drop 10.12 --- Aria2D.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Aria2D.xcodeproj/project.pbxproj b/Aria2D.xcodeproj/project.pbxproj index eabb103..464a444 100644 --- a/Aria2D.xcodeproj/project.pbxproj +++ b/Aria2D.xcodeproj/project.pbxproj @@ -923,7 +923,7 @@ "@executable_path/../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 1.3.7; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; ONLY_ACTIVE_ARCH = YES; @@ -962,7 +962,7 @@ "@executable_path/../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 1.3.7; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ""; From 64d477e231e86f9bd66a895be34db78eb9002e98 Mon Sep 17 00:00:00 2001 From: xjbeta Date: Tue, 15 Aug 2023 19:39:41 +0800 Subject: [PATCH 7/7] Bump version to 1.3.8. --- Aria2D.xcodeproj/project.pbxproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Aria2D.xcodeproj/project.pbxproj b/Aria2D.xcodeproj/project.pbxproj index 464a444..00c1666 100644 --- a/Aria2D.xcodeproj/project.pbxproj +++ b/Aria2D.xcodeproj/project.pbxproj @@ -924,7 +924,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 1.3.7; + MARKETING_VERSION = 1.3.8; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ""; @@ -963,7 +963,7 @@ ); LIBRARY_SEARCH_PATHS = "$(inherited)"; MACOSX_DEPLOYMENT_TARGET = 10.13; - MARKETING_VERSION = 1.3.7; + MARKETING_VERSION = 1.3.8; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ""; OTHER_SWIFT_FLAGS = "";