Fix content item view ID

This commit is contained in:
Arkadiusz Fal 2021-10-23 10:34:37 +02:00
parent 9464809581
commit 8a43ed9503

View File

@ -24,6 +24,8 @@ struct ContentItem: Identifiable {
var playlist: ChannelPlaylist!
var channel: Channel!
var id: String = UUID().uuidString
static func array(of videos: [Video]) -> [ContentItem] {
videos.map { ContentItem(video: $0) }
}
@ -32,10 +34,6 @@ struct ContentItem: Identifiable {
lhs.contentType < rhs.contentType
}
var id: String {
"\(contentType.rawValue)-\(video?.id ?? playlist?.id ?? channel?.id ?? "")"
}
var contentType: ContentType {
if !playlist.isNil {
return .playlist