mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-05 01:38:51 +01:00
fix: check if album is starred before adding the starred date in the response. also return "starred" in search responses
This commit is contained in:
parent
e032bfcf6b
commit
33ede13eef
5 changed files with 16 additions and 7 deletions
|
|
@ -165,10 +165,13 @@ func (b *browser) buildAlbumDir(al *model.Album, tracks model.MediaFiles) *Direc
|
|||
Genre: al.Genre,
|
||||
CoverArt: al.CoverArtId,
|
||||
PlayCount: int32(al.PlayCount),
|
||||
Starred: al.StarredAt,
|
||||
UserRating: al.Rating,
|
||||
}
|
||||
|
||||
if al.Starred {
|
||||
dir.Starred = al.StarredAt
|
||||
}
|
||||
|
||||
dir.Entries = FromMediaFiles(tracks)
|
||||
return dir
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@ func FromArtist(ar *model.Artist) Entry {
|
|||
e.Title = ar.Name
|
||||
e.AlbumCount = ar.AlbumCount
|
||||
e.IsDir = true
|
||||
e.Starred = ar.StarredAt
|
||||
if ar.Starred {
|
||||
e.Starred = ar.StarredAt
|
||||
}
|
||||
return e
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +73,9 @@ func FromAlbum(al *model.Album) Entry {
|
|||
e.ArtistId = al.ArtistID
|
||||
e.Duration = int(al.Duration)
|
||||
e.SongCount = al.SongCount
|
||||
e.Starred = al.StarredAt
|
||||
if al.Starred {
|
||||
e.Starred = al.StarredAt
|
||||
}
|
||||
e.PlayCount = int32(al.PlayCount)
|
||||
e.UserRating = al.Rating
|
||||
return e
|
||||
|
|
@ -107,7 +111,9 @@ func FromMediaFile(mf *model.MediaFile) Entry {
|
|||
e.ArtistId = mf.ArtistID
|
||||
e.Type = "music"
|
||||
e.PlayCount = int32(mf.PlayCount)
|
||||
e.Starred = mf.StarredAt
|
||||
if mf.Starred {
|
||||
e.Starred = mf.StarredAt
|
||||
}
|
||||
e.UserRating = mf.Rating
|
||||
return e
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue