Skip to content

Commit 835f9fb

Browse files
committed
Fix Add Client UI Crash & Tracker Parsing Bug
1 parent f590aa2 commit 835f9fb

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

Deluge Remote.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@
724724
"@executable_path/Frameworks",
725725
);
726726
LIBRARY_SEARCH_PATHS = "";
727-
MARKETING_VERSION = 1.5.5;
727+
MARKETING_VERSION = 1.5.6;
728728
OTHER_LDFLAGS = "-ObjC";
729729
PRODUCT_BUNDLE_IDENTIFIER = "io.rudybermudez.Deluge-Remote";
730730
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -756,7 +756,7 @@
756756
"@executable_path/Frameworks",
757757
);
758758
LIBRARY_SEARCH_PATHS = "";
759-
MARKETING_VERSION = 1.5.5;
759+
MARKETING_VERSION = 1.5.6;
760760
OTHER_LDFLAGS = "-ObjC";
761761
PRODUCT_BUNDLE_IDENTIFIER = "io.rudybermudez.Deluge-Remote";
762762
PRODUCT_NAME = "$(TARGET_NAME)";

Deluge Remote/Resources/Base.lproj/Main.storyboard

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,13 @@
453453
</navigationItem>
454454
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
455455
<connections>
456+
<outlet property="hostnameTextField" destination="SIf-P6-25J" id="zmL-AD-veC"/>
457+
<outlet property="networkSecurityControl" destination="CxY-rK-tfD" id="fEF-3p-3Pa"/>
456458
<outlet property="nicknameTextField" destination="gR7-yB-iAd" id="VKL-b6-bSU"/>
459+
<outlet property="passwordTextField" destination="222-3p-ANZ" id="u0W-CX-XZx"/>
460+
<outlet property="portTableViewCell" destination="n1Z-TI-abn" id="9iA-pg-Jmv"/>
461+
<outlet property="portTextField" destination="QiW-cq-Ryr" id="4oW-xR-wUq"/>
462+
<outlet property="relativePathTextField" destination="IUq-f6-n0a" id="bWC-a0-gxo"/>
457463
</connections>
458464
</tableViewController>
459465
<placeholder placeholderIdentifier="IBFirstResponder" id="TwL-zY-yej" userLabel="First Responder" sceneMemberID="firstResponder"/>

Deluge Remote/Sources/API/DelugeClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class DelugeClient {
237237
Logger.error(ClientError.other(error))
238238
seal.reject(ClientError.other(error))
239239
} else if error.isResponseSerializationError {
240-
Logger.error(error.localizedDescription)
240+
Logger.error(error)
241241
seal.reject(ClientError.decoding)
242242
} else {
243243
Logger.error(error)

Deluge Remote/Sources/Models/Deluge/TorrentMetadata.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ struct TrackerMetadata: Decodable {
100100
let last_error: ErrorMetadata?
101101
let fail_limit: Int?
102102
let next_announce: Int?
103-
let complete_sent: Bool
104-
let source: Int
103+
let complete_sent: Bool?
104+
let source: Int?
105105
let trackerid: String?
106-
let start_sent: Bool
107-
let tier: Int
106+
let start_sent: Bool?
107+
let tier: Int?
108108
let scrape_complete: Int?
109109
let message: String?
110-
let updating: Bool
110+
let updating: Bool?
111111
}
112112

113113
struct ErrorMetadata: Decodable {

Deluge Remote/Sources/View Controllers/AddClientViewController.swift

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,18 @@ class AddClientViewController: UITableViewController, Storyboarded {
4242
let relativePath = relativePathTextField.text
4343
else { return }
4444

45-
if nickname.isEmpty { showAlert(target: self, title: "Nickname cannot be left empty")}
46-
if hostname.isEmpty { showAlert(target: self, title: "Hostname cannot be empty")}
47-
if portString.isEmpty { showAlert(target: self, title: "Port cannot be empty")}
45+
if nickname.isEmpty {
46+
showAlert(target: self, title: "Nickname cannot be left empty")
47+
return
48+
}
49+
if hostname.isEmpty {
50+
showAlert(target: self, title: "Hostname cannot be empty")
51+
return
52+
}
53+
if portString.isEmpty {
54+
showAlert(target: self, title: "Port cannot be empty")
55+
return
56+
}
4857

4958
guard let port = Int(portString) else {
5059
showAlert(target: self, title: "Port must be a numeric type")

0 commit comments

Comments
 (0)