mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Refactor
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user