From 6bff8789525cd44aa1ad22a80a724ff50585a9e5 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 26 Apr 2022 22:12:22 +0200 Subject: [PATCH] Fix repeating "Default" servers in some providers Disambiguate by apiId. --- .../App/Extensions/PassepartoutProviders+Extensions.swift | 7 ++++++- Passepartout/App/L10n/Providers+L10n.swift | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift b/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift index a14b97a8..49890e3d 100644 --- a/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift +++ b/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift @@ -75,7 +75,12 @@ extension ProviderServer: Comparable { if let li = lhs.serverIndex, let ri = rhs.serverIndex { return li < ri } - return lhs.localizedDetails < rhs.localizedDetails + let ld = lhs.localizedDetails + let rd = rhs.localizedDetails + if ld != rd { + return ld < rd + } + return lhs.apiId < rhs.apiId } } diff --git a/Passepartout/App/L10n/Providers+L10n.swift b/Passepartout/App/L10n/Providers+L10n.swift index 0991e484..b087aee7 100644 --- a/Passepartout/App/L10n/Providers+L10n.swift +++ b/Passepartout/App/L10n/Providers+L10n.swift @@ -87,7 +87,7 @@ extension ProviderServer { } var localizedDetailsWithDefault: String { - return details ?? L10n.Global.Strings.default + return details ?? "\(L10n.Global.Strings.default) [\(apiId)]" } }