Fix API type checking and lint

This commit is contained in:
lucast committed 2026-10-07 00:53:14 +02:00
1 parent 3d07a77cb9
commit 36f2b2d843
5 files changed
+247 -59

No files matched your search

+18 -5
View File
@@ -19,13 +19,19 @@ nonisolated public struct Artist: Decodable, Identifiable, Sendable {
public let id: String
public let name: String
public let file: String?
enum CodingKeys: String, CodingKey { case id = "_id", name, file }
enum CodingKeys: String, CodingKey {
case id = "_id"
case name, file
}
}
nonisolated public struct Genre: Decodable, Identifiable, Sendable {
public let id: String
public let name: String
enum CodingKeys: String, CodingKey { case id = "_id", name }
enum CodingKeys: String, CodingKey {
case id = "_id"
case name
}
}
nonisolated public struct Album: Decodable, Identifiable, Sendable {
@@ -34,7 +40,10 @@ nonisolated public struct Album: Decodable, Identifiable, Sendable {
public let artists: [APIReference<Artist>]
public let file: String?
public let genre: APIReference<Genre>?
enum CodingKeys: String, CodingKey { case id = "_id", name, artists, file, genre }
enum CodingKeys: String, CodingKey {
case id = "_id"
case name, artists, file, genre
}
}
nonisolated public struct Lyrics: Decodable, Sendable {
@@ -51,7 +60,8 @@ nonisolated public struct Track: Decodable, Identifiable, Sendable {
public let durationInSeconds: Double
public let lyrics: Lyrics?
enum CodingKeys: String, CodingKey {
case id = "_id", name, album, artists, fileDir, durationInSeconds, lyrics
case id = "_id"
case name, album, artists, fileDir, durationInSeconds, lyrics
}
}
@@ -61,7 +71,10 @@ nonisolated public struct User: Decodable, Identifiable, Sendable {
public let email: String
public let role: String
public let savedTracks: [String]?
enum CodingKeys: String, CodingKey { case id = "_id", name, email, role, savedTracks }
enum CodingKeys: String, CodingKey {
case id = "_id"
case name, email, role, savedTracks
}
}
nonisolated public struct SessionStatus: Decodable, Sendable { public let authenticated: Bool }