Caching for favorites

This commit is contained in:
Arkadiusz Fal
2022-12-16 12:31:43 +01:00
parent a2c69e0fed
commit b8f693e213
4 changed files with 75 additions and 26 deletions

View File

@@ -40,7 +40,7 @@ struct Playlist: Identifiable, Equatable, Hashable {
}
var json: JSON {
return [
[
"id": id,
"title": title,
"visibility": visibility.rawValue,
@@ -51,7 +51,7 @@ struct Playlist: Identifiable, Equatable, Hashable {
}
static func from(_ json: JSON) -> Self {
return .init(
.init(
id: json["id"].stringValue,
title: json["title"].stringValue,
visibility: .init(rawValue: json["visibility"].stringValue) ?? .public,