import Foundation struct ArtistJSON: Decodable { let id: String let name: String let sortName: String? let coverArt: String? let albumCount: Int? let starred: String? } struct AlbumJSON: Decodable { let id: String let song: [SongJSON]? let name: String let artist: String? let artistId: String? let coverArt: String? let songCount: Int? let duration: Double? let created: String? let year: Int? let genre: String? let starred: String? } struct SongJSON: Decodable { let id: String let title: String let album: String? let albumId: String? let artist: String? let artistId: String? let track: Int? let discNumber: Int? let year: Int? let genre: String? let coverArt: String? let suffix: String? let bitRate: Int? let samplingRate: Int? let bitDepth: Int? let channelCount: Int? let duration: Double? let playCount: Int? let played: String? let starred: String? let explicitStatus: String? } struct PlaylistJSON: Decodable { let id: String let name: String let comment: String? let coverArt: String? let songCount: Int? let duration: Double? let changed: String? let entry: [SongJSON]? } struct StationJSON: Decodable { let id: String let name: String let streamUrl: String let homePageUrl: String? let coverArt: String? } struct StructuredLyricsJSON: Decodable { struct Line: Decodable { let start: Int? let value: String } let lang: String? let synced: Bool let offset: Int? let line: [Line]? } struct ArtistsPayload: Decodable { struct Index: Decodable { let artist: [ArtistJSON]? } struct Artists: Decodable { let index: [Index]? } let artists: Artists } struct AlbumListPayload: Decodable { struct List: Decodable { let album: [AlbumJSON]? } let albumList2: List } struct AlbumPayload: Decodable { let album: AlbumJSON } struct SearchPayload: Decodable { struct Result: Decodable { let song: [SongJSON]? } let searchResult3: Result } struct PlaylistsPayload: Decodable { struct List: Decodable { let playlist: [PlaylistJSON]? } let playlists: List } struct PlaylistPayload: Decodable { let playlist: PlaylistJSON } struct StationsPayload: Decodable { struct List: Decodable { let internetRadioStation: [StationJSON]? } let internetRadioStations: List } struct StarredPayload: Decodable { struct Starred: Decodable { let artist: [ArtistJSON]? let album: [AlbumJSON]? let song: [SongJSON]? } let starred2: Starred } struct LyricsPayload: Decodable { struct List: Decodable { let structuredLyrics: [StructuredLyricsJSON]? } let lyricsList: List }