Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove songCount form getAlbumList response #503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/ctrlsubsonic/handlers_by_folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response {
// TODO: think about removing this extra join to count number
// of children. it might make sense to store that in the db
q.
Select("albums.*, count(tracks.id) child_count, sum(tracks.length) duration").
Select("albums.*, sum(tracks.length) duration").
Joins("LEFT JOIN tracks ON tracks.album_id=albums.id").
Group("albums.id").
Joins("JOIN album_artists ON album_artists.album_id=albums.id").
Expand Down
16 changes: 8 additions & 8 deletions server/ctrlsubsonic/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ type Album struct {
IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"`
CoverID *specid.ID `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"`

Name string `xml:"name,attr" json:"name"`
TrackCount int `xml:"songCount,attr" json:"songCount"`
Duration int `xml:"duration,attr" json:"duration"`
PlayCount int `xml:"playCount,attr" json:"playCount"`
Genre string `xml:"genre,attr,omitempty" json:"genre,omitempty"`
Genres []*GenreRef `xml:"genres,omitempty" json:"genres,omitempty"`
Year int `xml:"year,attr,omitempty" json:"year,omitempty"`
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`
Name string `xml:"name,attr" json:"name"`
TrackCount int `xml:"songCount,attr,omitempty" json:"songCount,omitempty"`
Duration int `xml:"duration,attr" json:"duration"`
PlayCount int `xml:"playCount,attr" json:"playCount"`
Genre string `xml:"genre,attr,omitempty" json:"genre,omitempty"`
Genres []*GenreRef `xml:"genres,omitempty" json:"genres,omitempty"`
Year int `xml:"year,attr,omitempty" json:"year,omitempty"`
Tracks []*TrackChild `xml:"song,omitempty" json:"song,omitempty"`

// star / rating
Starred *time.Time `xml:"starred,attr,omitempty" json:"starred,omitempty"`
Expand Down
Loading