fix(subsonic): order some browse-by-tag responses

closes #512
This commit is contained in:
mikuta0407
2025-02-15 16:16:10 +00:00
committed by sentriz
parent 5c7d065fd7
commit 39df00ef8f
4 changed files with 16 additions and 0 deletions

No files matched your search

@@ -80,11 +80,13 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response {
Where("parent_id=?", id.Value).
Preload("AlbumStar", "user_id=?", user.ID).
Preload("AlbumRating", "user_id=?", user.ID).
Order("tag_year").
Order("albums.right_path COLLATE NOCASE").
Find(&childFolders)
for _, ch := range childFolders {
childrenObj = append(childrenObj, spec.NewTCAlbumByFolder(ch))
}
// start looking for child childTracks in the current dir
var childTracks []*db.Track
c.dbc.
@@ -94,6 +96,7 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response {
Preload("Artists").
Preload("TrackStar", "user_id=?", user.ID).
Preload("TrackRating", "user_id=?", user.ID).
Order("tag_track_number").
Order("filename").
Find(&childTracks)
@@ -40,6 +40,7 @@ func NewTCAlbumByFolder(f *db.Album) *TrackChild {
ParentID: f.ParentSID(),
CreatedAt: f.CreatedAt,
AverageRating: formatRating(f.AverageRating),
Year: f.TagYear,
}
if f.AlbumStar != nil {
trCh.Starred = &f.AlbumStar.StarDate
@@ -23,6 +23,7 @@
"isVideo": false,
"parent": "al-2",
"title": "album-0",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -39,6 +40,7 @@
"isVideo": false,
"parent": "al-2",
"title": "album-1",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -55,6 +57,7 @@
"isVideo": false,
"parent": "al-2",
"title": "album-2",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
}
+9
View File
@@ -20,6 +20,7 @@
"isVideo": false,
"parent": "al-2",
"title": "album-0",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -36,6 +37,7 @@
"isVideo": false,
"parent": "al-2",
"title": "album-1",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -52,6 +54,7 @@
"isVideo": false,
"parent": "al-2",
"title": "album-2",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -68,6 +71,7 @@
"isVideo": false,
"parent": "al-6",
"title": "album-0",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -84,6 +88,7 @@
"isVideo": false,
"parent": "al-6",
"title": "album-1",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -100,6 +105,7 @@
"isVideo": false,
"parent": "al-6",
"title": "album-2",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -116,6 +122,7 @@
"isVideo": false,
"parent": "al-10",
"title": "album-0",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -132,6 +139,7 @@
"isVideo": false,
"parent": "al-10",
"title": "album-1",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
},
@@ -148,6 +156,7 @@
"isVideo": false,
"parent": "al-10",
"title": "album-2",
"year": 2021,
"musicBrainzId": "",
"replayGain": null
}