From 960e7bdaf17ab298c2e6b5c4c8f1ecb608139d01 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Fri, 16 Dec 2022 12:31:14 +0100 Subject: [PATCH] More channel cache --- Model/Channel.swift | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Model/Channel.swift b/Model/Channel.swift index 64c1714a..4bdb1561 100644 --- a/Model/Channel.swift +++ b/Model/Channel.swift @@ -140,7 +140,12 @@ struct Channel: Identifiable, Hashable { "app": app.rawValue, "id": id, "name": name, - "thumbnailURL": thumbnailURL?.absoluteString ?? "", + "bannerURL": bannerURL?.absoluteString as Any, + "thumbnailURL": thumbnailURL?.absoluteString as Any, + "subscriptionsCount": subscriptionsCount as Any, + "subscriptionsText": subscriptionsText as Any, + "totalViews": totalViews as Any, + "verified": verified as Any, "videos": videos.map { $0.json.object } ] } @@ -150,7 +155,11 @@ struct Channel: Identifiable, Hashable { app: VideosApp(rawValue: json["app"].stringValue) ?? .local, id: json["id"].stringValue, name: json["name"].stringValue, + bannerURL: json["bannerURL"].url, thumbnailURL: json["thumbnailURL"].url, + subscriptionsCount: json["subscriptionsCount"].int, + subscriptionsText: json["subscriptionsText"].string, + totalViews: json["totalViews"].int, videos: json["videos"].arrayValue.map { Video.from($0) } ) }