Add missing model fields from Python audit
LandingList: Added type, type_for_from, title, id, new_releases, new_playlists, podcasts New type: PlaylistID Presaves: Added upcoming_albums, released_albums Presaves: Added DeJSON method QueueItem: Added id, context, modified fields (fixed duplicate context) Clip: Fixed PreviewURI → PreviewURL field name
This commit is contained in:
1 parent
463e0bcd1a
commit
9d3bcc4a9b
3 files changed
+109
-17
No files matched your search
@@ -93,13 +93,15 @@ func (q *Queue) DeList(data []byte, c ClientInterface) ([]Model, error) {
|
||||
// QueueItem represents a queue item.
|
||||
type QueueItem struct {
|
||||
BaseModel
|
||||
TrackID string `json:"track_id"`
|
||||
Track *Track `json:"track"`
|
||||
Position int `json:"position"`
|
||||
AddedAt string `json:"added_at"`
|
||||
AddedBy string `json:"added_by"`
|
||||
Playable bool `json:"playable"`
|
||||
PlayContext *PlayContext `json:"play_context"`
|
||||
ID JSONID `json:"id"`
|
||||
TrackID string `json:"track_id"`
|
||||
Track *Track `json:"track"`
|
||||
Position int `json:"position"`
|
||||
AddedAt string `json:"added_at"`
|
||||
AddedBy string `json:"added_by"`
|
||||
Playable bool `json:"playable"`
|
||||
Modified string `json:"modified"`
|
||||
Context *PlayContext `json:"context"`
|
||||
}
|
||||
|
||||
// DeJSON deserializes a QueueItem from JSON data.
|
||||
@@ -132,10 +134,10 @@ func (qi *QueueItem) DeJSON(data []byte, c ClientInterface) (Model, error) {
|
||||
json.Unmarshal(v, &track)
|
||||
item.Track = &track
|
||||
}
|
||||
if v, ok := raw["play_context"]; ok {
|
||||
if v, ok := raw["context"]; ok {
|
||||
var ctx PlayContext
|
||||
json.Unmarshal(v, &ctx)
|
||||
item.PlayContext = &ctx
|
||||
item.Context = &ctx
|
||||
}
|
||||
|
||||
return item, nil
|
||||
|
||||
Reference in new issue
Block a user