From 76a827029311ec834c4b8908414b6e1bfc6b63f6 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 17 Aug 2022 00:33:23 +0200 Subject: [PATCH] Improve quality profile formats description --- Model/QualityProfile.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Model/QualityProfile.swift b/Model/QualityProfile.swift index 993a60a2..a2c1a1d7 100644 --- a/Model/QualityProfile.swift +++ b/Model/QualityProfile.swift @@ -57,7 +57,17 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable { var description: String { if let name = name, !name.isEmpty { return name } - return "\(backend.label) - \(resolution.description) - \(formats.map(\.description).joined(separator: ", "))" + return "\(backend.label) - \(resolution.description) - \(formatsDescription)" + } + + var formatsDescription: String { + if formats.count == Format.allCases.count { + return "Any format" + } else if formats.count <= 3 { + return formats.map(\.description).joined(separator: ", ") + } + + return "\(formats.count) formats" } func isPreferred(_ stream: Stream) -> Bool {