This commit is contained in:
Arkadiusz Fal
2022-12-16 20:37:05 +01:00
parent b621eba236
commit f39b440b21
9 changed files with 34 additions and 18 deletions

View File

@@ -49,4 +49,17 @@ struct ContentItem: Identifiable {
var contentType: ContentType {
video.isNil ? (channel.isNil ? (playlist.isNil ? .placeholder : .playlist) : .channel) : .video
}
var cacheKey: String {
switch contentType {
case .video:
return video.cacheKey
case .playlist:
return playlist.cacheKey
case .channel:
return channel.cacheKey
case .placeholder:
return id
}
}
}