mirror of
https://github.com/yattee/yattee.git
synced 2025-10-09 00:48:10 +00:00
@@ -34,11 +34,11 @@ struct ChannelsCacheModel: CacheModel {
|
||||
store(channel)
|
||||
}
|
||||
|
||||
func retrieve(_ cacheKey: String) -> Channel? {
|
||||
func retrieve(_ cacheKey: String) -> ChannelPage? {
|
||||
logger.debug("retrieving cache for \(cacheKey)")
|
||||
|
||||
if let json = try? storage?.object(forKey: cacheKey) {
|
||||
return Channel.from(json)
|
||||
return ChannelPage(channel: Channel.from(json))
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@@ -110,12 +110,12 @@ final class SubscribedChannelsModel: ObservableObject, CacheModel {
|
||||
if let json = try? storage?.object(forKey: channelsCacheKey(account)),
|
||||
let channels = json.dictionaryValue["channels"]
|
||||
{
|
||||
return channels.arrayValue.map { json in
|
||||
return channels.arrayValue.compactMap { json in
|
||||
let channel = Channel.from(json)
|
||||
if !channel.hasExtendedDetails,
|
||||
let cache = ChannelsCacheModel.shared.retrieve(channel.cacheKey)
|
||||
{
|
||||
return cache
|
||||
return cache.channel
|
||||
}
|
||||
|
||||
return channel
|
||||
|
Reference in New Issue
Block a user