From 72eb314267739bcd2cd0a9cbdb050a8a0d0352b5 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Fri, 7 Nov 2025 16:33:22 -0800 Subject: [PATCH] update play queue types --- server/subsonic/bookmarks.go | 4 ++-- ... PlayQueue without data should match .JSON | 1 + ...s PlayQueue without data should match .XML | 2 +- ...eueByIndex without data should match .JSON | 1 + ...ueueByIndex without data should match .XML | 2 +- server/subsonic/responses/responses.go | 24 +++++++++---------- server/subsonic/responses/responses_test.go | 4 ++-- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/server/subsonic/bookmarks.go b/server/subsonic/bookmarks.go index 00c1f2934..b1e71b1c7 100644 --- a/server/subsonic/bookmarks.go +++ b/server/subsonic/bookmarks.go @@ -91,7 +91,7 @@ func (api *Router) GetPlayQueue(r *http.Request) (*responses.Subsonic, error) { Current: currentID, Position: pq.Position, Username: user.UserName, - Changed: &pq.UpdatedAt, + Changed: pq.UpdatedAt, ChangedBy: pq.ChangedBy, } return response, nil @@ -160,7 +160,7 @@ func (api *Router) GetPlayQueueByIndex(r *http.Request) (*responses.Subsonic, er CurrentIndex: index, Position: pq.Position, Username: user.UserName, - Changed: &pq.UpdatedAt, + Changed: pq.UpdatedAt, ChangedBy: pq.ChangedBy, } return response, nil diff --git a/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .JSON b/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .JSON index 88eebb276..70b10c059 100644 --- a/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .JSON +++ b/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .JSON @@ -6,6 +6,7 @@ "openSubsonic": true, "playQueue": { "username": "", + "changed": "0001-01-01T00:00:00Z", "changedBy": "" } } diff --git a/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .XML b/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .XML index 5af3d9157..597781cbd 100644 --- a/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .XML +++ b/server/subsonic/responses/.snapshots/Responses PlayQueue without data should match .XML @@ -1,3 +1,3 @@ - + diff --git a/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .JSON b/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .JSON index c360e422e..ad49a35e5 100644 --- a/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .JSON +++ b/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .JSON @@ -6,6 +6,7 @@ "openSubsonic": true, "playQueueByIndex": { "username": "", + "changed": "0001-01-01T00:00:00Z", "changedBy": "" } } diff --git a/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .XML b/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .XML index 80aa146be..d99681f4c 100644 --- a/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .XML +++ b/server/subsonic/responses/.snapshots/Responses PlayQueueByIndex without data should match .XML @@ -1,3 +1,3 @@ - + diff --git a/server/subsonic/responses/responses.go b/server/subsonic/responses/responses.go index 150214096..0724d2fff 100644 --- a/server/subsonic/responses/responses.go +++ b/server/subsonic/responses/responses.go @@ -440,21 +440,21 @@ type TopSongs struct { } type PlayQueue struct { - Entry []Child `xml:"entry,omitempty" json:"entry,omitempty"` - Current string `xml:"current,attr,omitempty" json:"current,omitempty"` - Position int64 `xml:"position,attr,omitempty" json:"position,omitempty"` - Username string `xml:"username,attr" json:"username"` - Changed *time.Time `xml:"changed,attr,omitempty" json:"changed,omitempty"` - ChangedBy string `xml:"changedBy,attr" json:"changedBy"` + Entry []Child `xml:"entry,omitempty" json:"entry,omitempty"` + Current string `xml:"current,attr,omitempty" json:"current,omitempty"` + Position int64 `xml:"position,attr,omitempty" json:"position,omitempty"` + Username string `xml:"username,attr" json:"username"` + Changed time.Time `xml:"changed,attr" json:"changed"` + ChangedBy string `xml:"changedBy,attr" json:"changedBy"` } type PlayQueueByIndex struct { - Entry []Child `xml:"entry,omitempty" json:"entry,omitempty"` - CurrentIndex *int `xml:"currentIndex,attr,omitempty" json:"currentIndex,omitempty"` - Position int64 `xml:"position,attr,omitempty" json:"position,omitempty"` - Username string `xml:"username,attr" json:"username"` - Changed *time.Time `xml:"changed,attr,omitempty" json:"changed,omitempty"` - ChangedBy string `xml:"changedBy,attr" json:"changedBy"` + Entry []Child `xml:"entry,omitempty" json:"entry,omitempty"` + CurrentIndex *int `xml:"currentIndex,attr,omitempty" json:"currentIndex,omitempty"` + Position int64 `xml:"position,attr,omitempty" json:"position,omitempty"` + Username string `xml:"username,attr" json:"username"` + Changed time.Time `xml:"changed,attr" json:"changed"` + ChangedBy string `xml:"changedBy,attr" json:"changedBy"` } type Bookmark struct { diff --git a/server/subsonic/responses/responses_test.go b/server/subsonic/responses/responses_test.go index 1081c8382..2ee8e080d 100644 --- a/server/subsonic/responses/responses_test.go +++ b/server/subsonic/responses/responses_test.go @@ -768,7 +768,7 @@ var _ = Describe("Responses", func() { response.PlayQueue.Username = "user1" response.PlayQueue.Current = "111" response.PlayQueue.Position = 243 - response.PlayQueue.Changed = &time.Time{} + response.PlayQueue.Changed = time.Time{} response.PlayQueue.ChangedBy = "a_client" child := make([]Child, 1) child[0] = Child{Id: "1", Title: "title", IsDir: false} @@ -802,7 +802,7 @@ var _ = Describe("Responses", func() { response.PlayQueueByIndex.Username = "user1" response.PlayQueueByIndex.CurrentIndex = gg.P(0) response.PlayQueueByIndex.Position = 243 - response.PlayQueueByIndex.Changed = &time.Time{} + response.PlayQueueByIndex.Changed = time.Time{} response.PlayQueueByIndex.ChangedBy = "a_client" child := make([]Child, 1) child[0] = Child{Id: "1", Title: "title", IsDir: false}