fix a crash when format is hls

This commit is contained in:
Toni Förster 2024-05-09 21:15:14 +02:00
parent ef7a486fd4
commit d8c8f8084b
No known key found for this signature in database
GPG Key ID: 292F3E5086C83FC7

View File

@ -176,6 +176,11 @@ class Stream: Equatable, Hashable, Identifiable {
var quality: String {
guard localURL.isNil else { return "Opened File" }
if kind == .hls {
return "adaptive (HLS)"
}
return resolution.name
}
@ -183,7 +188,7 @@ class Stream: Equatable, Hashable, Identifiable {
guard localURL.isNil else { return "File" }
if kind == .hls {
return format.description
return "adaptive (HLS)"
}
if kind == .stream {
@ -195,7 +200,7 @@ class Stream: Equatable, Hashable, Identifiable {
var description: String {
guard localURL.isNil else { return resolutionAndFormat }
let instanceString = instance.isNil ? "" : " - (\(instance!.description))"
return format != .hls ? "\(resolutionAndFormat)\(instanceString)" : "\(format.description)\(instanceString)"
return format != .hls ? "\(resolutionAndFormat)\(instanceString)" : "adaptive (HLS)\(instanceString)"
}
var resolutionAndFormat: String {