diff --git a/Aria2D.xcodeproj/project.pbxproj b/Aria2D.xcodeproj/project.pbxproj index eabb103..00c1666 100644 --- a/Aria2D.xcodeproj/project.pbxproj +++ b/Aria2D.xcodeproj/project.pbxproj @@ -923,8 +923,8 @@ "@executable_path/../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.3.7; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.3.8; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ""; @@ -962,8 +962,8 @@ "@executable_path/../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MACOSX_DEPLOYMENT_TARGET = 10.12; - MARKETING_VERSION = 1.3.7; + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 1.3.8; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = ""; OTHER_SWIFT_FLAGS = ""; 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" } }, { 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/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) 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) { 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 } } 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"