Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
xjbeta committed Aug 15, 2023
2 parents e0defa6 + 64d477e commit 4fb7a32
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
8 changes: 4 additions & 4 deletions Aria2D.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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 = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/mxcl/PromiseKit",
"state" : {
"revision" : "ed3192004c0b00b4b3d7baa9578ee655c66faae3",
"version" : "6.18.0"
"revision" : "8a98e31a47854d3180882c8068cc4d9381bf382d",
"version" : "6.22.1"
}
},
{
"identity" : "sparkle",
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
"revision" : "059ce9128775d5a636c7f4716f71a58919d3111e",
"version" : "2.2.1"
"revision" : "87e4fcbac39912f9cdb9a9acf205cad60e1ca3bc",
"version" : "2.4.2"
}
},
{
Expand Down
11 changes: 11 additions & 0 deletions Aria2D/Aria2/Aria2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down
4 changes: 1 addition & 3 deletions Aria2D/Aria2/Aria2Websocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Aria2D/Views/ServerListArrayController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions Aria2D/Views/Sidebar/SidebarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
4 changes: 0 additions & 4 deletions Cartfile.resolved

This file was deleted.

0 comments on commit 4fb7a32

Please sign in to comment.