Skip to content

Commit 77f8ca7

Browse files
committed
Remove Pesky Alerts, Fix optional data & Fix Typo
1 parent f555aa9 commit 77f8ca7

File tree

8 files changed

+63
-13
lines changed

8 files changed

+63
-13
lines changed

Deluge Remote.xcodeproj/project.pbxproj

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
472AA9672593FE4200529B45 /* TorrentSortingPopup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 472AA9662593FE4200529B45 /* TorrentSortingPopup.swift */; };
3434
472AA96A25940AE600529B45 /* SlideInPresentationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 472AA96925940AE600529B45 /* SlideInPresentationManager.swift */; };
3535
472AA96D25940B8C00529B45 /* SlideInPresentationController .swift in Sources */ = {isa = PBXBuildFile; fileRef = 472AA96C25940B8C00529B45 /* SlideInPresentationController .swift */; };
36+
473CB8BD2595C9B700A4B3EF /* NotificationBannerSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 473CB8BC2595C9B700A4B3EF /* NotificationBannerSwift */; };
3637
473D1F75258AE16E00045DB0 /* ChevronTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 473D1F74258AE16E00045DB0 /* ChevronTableViewCell.swift */; };
3738
473D1F79258B1C6E00045DB0 /* PlainCircularProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 473D1F78258B1C6E00045DB0 /* PlainCircularProgressBar.swift */; };
3839
473D1F7C258B1F7000045DB0 /* TorrentConnectedClientCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 473D1F7B258B1F6F00045DB0 /* TorrentConnectedClientCell.swift */; };
@@ -150,6 +151,7 @@
150151
buildActionMask = 2147483647;
151152
files = (
152153
47E68797259088AA008C2969 /* Houston in Frameworks */,
154+
473CB8BD2595C9B700A4B3EF /* NotificationBannerSwift in Frameworks */,
153155
47E685DF25907925008C2969 /* PromiseKit in Frameworks */,
154156
47E685EB259079D0008C2969 /* IQKeyboardManagerSwift in Frameworks */,
155157
47E685CF25907874008C2969 /* Alamofire in Frameworks */,
@@ -399,6 +401,7 @@
399401
47C801262592D09100A01831 /* ActiveLabel */,
400402
470F5CFD2594A0E700B7155D /* FirebaseCrashlytics */,
401403
470F5D012594A14600B7155D /* FirebaseAnalytics */,
404+
473CB8BC2595C9B700A4B3EF /* NotificationBannerSwift */,
402405
);
403406
productName = "Deluge Remote";
404407
productReference = 4716022E1DD4305800727CBD /* Deluge Remote.app */;
@@ -448,6 +451,7 @@
448451
47C8011A259280F000A01831 /* XCRemoteSwiftPackageReference "expandable-collection-view-kit" */,
449452
47C801252592D09100A01831 /* XCRemoteSwiftPackageReference "ActiveLabel.swift" */,
450453
470F5CFC2594A0E700B7155D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
454+
473CB8BB2595C9B700A4B3EF /* XCRemoteSwiftPackageReference "NotificationBanner" */,
451455
);
452456
productRefGroup = 4716022F1DD4305800727CBD /* Products */;
453457
projectDirPath = "";
@@ -720,7 +724,7 @@
720724
"@executable_path/Frameworks",
721725
);
722726
LIBRARY_SEARCH_PATHS = "";
723-
MARKETING_VERSION = 1.5;
727+
MARKETING_VERSION = 1.5.1;
724728
OTHER_LDFLAGS = "-ObjC";
725729
PRODUCT_BUNDLE_IDENTIFIER = "io.rudybermudez.Deluge-Remote";
726730
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -752,7 +756,7 @@
752756
"@executable_path/Frameworks",
753757
);
754758
LIBRARY_SEARCH_PATHS = "";
755-
MARKETING_VERSION = 1.5;
759+
MARKETING_VERSION = 1.5.1;
756760
OTHER_LDFLAGS = "-ObjC";
757761
PRODUCT_BUNDLE_IDENTIFIER = "io.rudybermudez.Deluge-Remote";
758762
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -795,6 +799,14 @@
795799
minimumVersion = 7.3.1;
796800
};
797801
};
802+
473CB8BB2595C9B700A4B3EF /* XCRemoteSwiftPackageReference "NotificationBanner" */ = {
803+
isa = XCRemoteSwiftPackageReference;
804+
repositoryURL = "https://github.com/Daltron/NotificationBanner.git";
805+
requirement = {
806+
kind = upToNextMajorVersion;
807+
minimumVersion = 3.0.6;
808+
};
809+
};
798810
47C8011A259280F000A01831 /* XCRemoteSwiftPackageReference "expandable-collection-view-kit" */ = {
799811
isa = XCRemoteSwiftPackageReference;
800812
repositoryURL = "https://github.com/RudyB/expandable-collection-view-kit.git";
@@ -880,6 +892,11 @@
880892
package = 470F5CFC2594A0E700B7155D /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
881893
productName = FirebaseAnalytics;
882894
};
895+
473CB8BC2595C9B700A4B3EF /* NotificationBannerSwift */ = {
896+
isa = XCSwiftPackageProductDependency;
897+
package = 473CB8BB2595C9B700A4B3EF /* XCRemoteSwiftPackageReference "NotificationBanner" */;
898+
productName = NotificationBannerSwift;
899+
};
883900
47C8011B259280F000A01831 /* ExpandableCollectionViewKit */ = {
884901
isa = XCSwiftPackageProductDependency;
885902
package = 47C8011A259280F000A01831 /* XCRemoteSwiftPackageReference "expandable-collection-view-kit" */;

Deluge Remote.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Deluge Remote/Sources/API/DelugeClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ enum ClientError: Error {
4949
case .unableToResumeTorrent(let errorMessage):
5050
return "Unable to Resume Torrent. \(errorMessage.localizedDescription)"
5151
case .unableToParseTableViewTorrent:
52-
return "The Data for Table View Torrent was unable to be parsed"
52+
return "Unable to parse Torrent Overview"
5353
case .unableToDeleteTorrent:
5454
return "The Torrent could not be deleted"
5555
case .unableToAddTorrent:
5656
return "The Torrent could not be added"
5757
case .unableToParseTorrentInfo:
58-
return "The Torrent Info could not be parsed"
58+
return "The Torrent Metadata could not be parsed"
5959
case .unableToParseTorrentFiles:
6060
return "The Torrent Files could not be parsed"
6161
case .failedToConvertTorrentToData:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct PeerMetadata: Decodable {
9191

9292
struct TrackerMetadata: Decodable {
9393
let send_stats: Bool?
94-
let fails: Int
94+
let fails: Int?
9595
let verified: Bool
9696
let scrape_incomplete: Int?
9797
let min_announce: Int?

Deluge Remote/Sources/Models/View Models/SettingsTableViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class AboutSection: SettingsTableViewSection {
7979
let bugReports = MenuCell(label: "Bug Reports / Feature Requests", icon: UIImage(named: "menu/bug")!) {
8080
UIApplication.shared.open(URL(string: "https://github.com/RudyB/Deluge-Remote/issues/")!)
8181
}
82-
let crashReporting = MenuCell(label: "Crash Reproting & Analytics", icon: UIImage(named: "menu/crash-reporting")!) { [weak self] in
82+
let crashReporting = MenuCell(label: "Crash Reporting & Analytics", icon: UIImage(named: "menu/crash-reporting")!) { [weak self] in
8383
self?.delegate?.showCrashReportingView()
8484
}
8585
let logs = MenuCell(label: "Logs", icon: UIImage(named: "menu/logs")!) { [weak self] in

Deluge Remote/Sources/View Controllers/AcknowledgementsTableViewController.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ fileprivate class MainSection: TableViewSection {
6868
cells.append(MenuCell(label: "MBProgressHUD", icon: UIImage(named: "menu/github")){
6969
UIApplication.shared.open(URL(string: "https://github.com/jdg/MBProgressHUD")!)
7070
})
71+
cells.append(MenuCell(label: "NotificationBanner", icon: UIImage(named: "menu/github")){
72+
UIApplication.shared.open(URL(string: "https://github.com/Daltron/NotificationBanner")!)
73+
})
7174
cells.append(MenuCell(label: "PromiseKit", icon: UIImage(named: "menu/github")){
7275
UIApplication.shared.open(URL(string: "https://github.com/mxcl/PromiseKit")!)
7376
})

Deluge Remote/Sources/View Controllers/MainTableViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import Houston
1010
import PromiseKit
1111
import UIKit
12+
import NotificationBannerSwift
1213

1314
protocol MainTableViewControllerDelegate: AnyObject {
1415
func torrentSelected(torrentHash: String)
@@ -485,7 +486,8 @@ class MainTableViewController: UITableViewController, Storyboarded {
485486

486487
if let error = error as? ClientError {
487488
Logger.error(error.domain())
488-
showAlert(target: self, title: "Error", message: error.domain())
489+
let banner = FloatingNotificationBanner(title: "Client Error", subtitle: error.domain(), style: .danger)
490+
banner.show()
489491
} else {
490492
Logger.error(error)
491493
}

Deluge Remote/Sources/View Controllers/TorrentDetailViewTabController.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import UIKit
1010
import Houston
11+
import NotificationBannerSwift
1112

1213
protocol TorrentDetailViewDelegate: AnyObject
1314
{
@@ -111,11 +112,11 @@ class TorrentDetailViewTabController: UITabBarController, Storyboarded {
111112
Logger.verbose("New Data")
112113
self?.torrentData = torrent
113114
self?.title = torrent.name
114-
}.catch { [weak self] error in
115+
}.catch { error in
115116
Logger.error(error)
116-
if let self = self, let error = error as? ClientError {
117-
showAlert(target: self, title: "Error", message: error.domain(),
118-
style: .alert)
117+
if let error = error as? ClientError {
118+
let banner = FloatingNotificationBanner(title: "Client Error", subtitle: error.domain(), style: .danger)
119+
banner.show()
119120
}
120121
}
121122
}
@@ -134,8 +135,8 @@ class TorrentDetailViewTabController: UITabBarController, Storyboarded {
134135
if case .torrentHasNoFiles = error {
135136
self.filesVC.tabBarItem.isEnabled = false
136137
} else {
137-
showAlert(target: self, title: "Error", message: error.domain(),
138-
style: .alert)
138+
let banner = FloatingNotificationBanner(title: "Client Error", subtitle: error.domain(), style: .danger)
139+
banner.show()
139140
}
140141
}
141142
}

0 commit comments

Comments
 (0)