iOS: stem playlist refresh and covers, download queue page, reorderable Library, whole-library radio
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c8dfb54ca
commit
a4c870251c
18 files changed
+514
-30
No files matched your search
@@ -263,6 +263,42 @@ struct PlexPin: Decodable {
|
||||
}
|
||||
}
|
||||
|
||||
/// One server from plex.tv/api/v2/resources, with every address it can be reached at.
|
||||
struct PlexResource: Decodable {
|
||||
struct Connection {
|
||||
var uri = ""
|
||||
var local = false
|
||||
var relay = false
|
||||
}
|
||||
var name = ""
|
||||
var clientIdentifier = ""
|
||||
var accessToken = ""
|
||||
var provides = ""
|
||||
var connections: [Connection] = []
|
||||
var isServer: Bool { provides.split(separator: ",").contains("server") }
|
||||
init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: AnyKey.self)
|
||||
name = c.str("name") ?? ""
|
||||
clientIdentifier = c.str("clientIdentifier") ?? ""
|
||||
accessToken = c.str("accessToken") ?? ""
|
||||
provides = c.str("provides") ?? ""
|
||||
connections = (try? c.decodeIfPresent([Lenient<PlexConn>].self, forKey: AnyKey("connections")))?
|
||||
.compactMap(\.value).map { Connection(uri: $0.uri, local: $0.local, relay: $0.relay) } ?? []
|
||||
}
|
||||
}
|
||||
|
||||
private struct PlexConn: Decodable {
|
||||
var uri = ""
|
||||
var local = false
|
||||
var relay = false
|
||||
init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: AnyKey.self)
|
||||
uri = c.str("uri") ?? ""
|
||||
local = c.bool("local") ?? false
|
||||
relay = c.bool("relay") ?? false
|
||||
}
|
||||
}
|
||||
|
||||
struct PlexUser: Decodable {
|
||||
var username: String?
|
||||
var title: String?
|
||||
|
||||
Reference in new issue
Block a user