make recently added persistent

This commit is contained in:
sentriz
2019-07-08 21:54:20 +01:00
parent 97b9837910
commit f2ac3b2cdf
7 changed files with 23 additions and 41 deletions

View File

@@ -9,7 +9,7 @@ import (
func newAlbumByTags(a *model.Album, artist *model.Artist) *subsonic.Album {
ret := &subsonic.Album{
Created: a.CreatedAt,
Created: a.ModifiedAt,
ID: a.ID,
Name: a.TagTitle,
}

View File

@@ -124,7 +124,7 @@ func (c *Controller) GetAlbumList(w http.ResponseWriter, r *http.Request) {
user.ID)
q = q.Order("plays.count DESC")
case "newest":
q = q.Order("updated_at DESC")
q = q.Order("modified_at DESC")
case "random":
q = q.Order(gorm.Expr("random()"))
case "recent":

View File

@@ -126,7 +126,7 @@ func (c *Controller) GetAlbumListTwo(w http.ResponseWriter, r *http.Request) {
user.ID)
q = q.Order("plays.count DESC")
case "newest":
q = q.Order("updated_at DESC")
q = q.Order("modified_at DESC")
case "random":
q = q.Order(gorm.Expr("random()"))
case "recent":