mirror of
https://github.com/yattee/yattee.git
synced 2025-04-27 23:40:35 +05:30
Fix content item view ID
This commit is contained in:
parent
9464809581
commit
8a43ed9503
@ -24,6 +24,8 @@ struct ContentItem: Identifiable {
|
|||||||
var playlist: ChannelPlaylist!
|
var playlist: ChannelPlaylist!
|
||||||
var channel: Channel!
|
var channel: Channel!
|
||||||
|
|
||||||
|
var id: String = UUID().uuidString
|
||||||
|
|
||||||
static func array(of videos: [Video]) -> [ContentItem] {
|
static func array(of videos: [Video]) -> [ContentItem] {
|
||||||
videos.map { ContentItem(video: $0) }
|
videos.map { ContentItem(video: $0) }
|
||||||
}
|
}
|
||||||
@ -32,10 +34,6 @@ struct ContentItem: Identifiable {
|
|||||||
lhs.contentType < rhs.contentType
|
lhs.contentType < rhs.contentType
|
||||||
}
|
}
|
||||||
|
|
||||||
var id: String {
|
|
||||||
"\(contentType.rawValue)-\(video?.id ?? playlist?.id ?? channel?.id ?? "")"
|
|
||||||
}
|
|
||||||
|
|
||||||
var contentType: ContentType {
|
var contentType: ContentType {
|
||||||
if !playlist.isNil {
|
if !playlist.isNil {
|
||||||
return .playlist
|
return .playlist
|
||||||
|
Loading…
x
Reference in New Issue
Block a user