mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Improve quality profile formats description
This commit is contained in:
parent
10fb417d87
commit
3999c19a6e
@ -57,7 +57,17 @@ struct QualityProfile: Hashable, Identifiable, Defaults.Serializable {
|
|||||||
|
|
||||||
var description: String {
|
var description: String {
|
||||||
if let name = name, !name.isEmpty { return name }
|
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 {
|
func isPreferred(_ stream: Stream) -> Bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user