mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-23 23:20:57 +03:00
Added Genre and Track Number to getMusicDirectory
This commit is contained in:
parent
838d4bf38f
commit
51bae19191
@ -46,6 +46,7 @@ func (c *GetMusicDirectoryController) Get() {
|
||||
dir.Child[i].Album = al.Name
|
||||
dir.Child[i].Year = al.Year
|
||||
dir.Child[i].Artist = a.Name
|
||||
dir.Child[i].Genre = al.Genre
|
||||
}
|
||||
} else {
|
||||
beego.Info("Artist", id, "not found")
|
||||
|
@ -8,6 +8,7 @@ type Album struct {
|
||||
Year int
|
||||
Compilation bool
|
||||
Rating int
|
||||
Genre string
|
||||
}
|
||||
|
||||
type AlbumRepository interface {
|
||||
|
@ -12,6 +12,8 @@ type MediaFile struct {
|
||||
Artist string
|
||||
AlbumArtist string
|
||||
AlbumId string `parent:"album"`
|
||||
Track int
|
||||
Genre string
|
||||
Compilation bool
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
|
@ -22,8 +22,10 @@ func (s *ItunesScanner) LoadFolder(path string) []Track {
|
||||
mediaFiles[i].Title = unescape(t.Name)
|
||||
mediaFiles[i].Artist = unescape(t.Artist)
|
||||
mediaFiles[i].AlbumArtist = unescape(t.AlbumArtist)
|
||||
mediaFiles[i].Genre = unescape(t.Genre)
|
||||
mediaFiles[i].Compilation = t.Compilation
|
||||
mediaFiles[i].Year = t.Year
|
||||
mediaFiles[i].TrackNumber = t.TrackNumber
|
||||
path, _ = url.QueryUnescape(t.Location)
|
||||
mediaFiles[i].Path = strings.TrimPrefix(path, "file://")
|
||||
mediaFiles[i].CreatedAt = t.DateAdded
|
||||
|
@ -74,12 +74,15 @@ func parseTrack(t *Track) (*domain.MediaFile, *domain.Album, *domain.Artist) {
|
||||
Path: t.Path,
|
||||
CreatedAt: t.CreatedAt,
|
||||
UpdatedAt: t.UpdatedAt,
|
||||
Track: t.TrackNumber,
|
||||
Genre: t.Genre,
|
||||
}
|
||||
|
||||
album := &domain.Album{
|
||||
Name: t.Album,
|
||||
Year: t.Year,
|
||||
Compilation: t.Compilation,
|
||||
Genre: t.Genre,
|
||||
}
|
||||
|
||||
artist := &domain.Artist{
|
||||
|
@ -11,6 +11,8 @@ type Track struct {
|
||||
Album string
|
||||
Artist string
|
||||
AlbumArtist string
|
||||
Genre string
|
||||
TrackNumber int
|
||||
Year int
|
||||
Compilation bool
|
||||
CreatedAt time.Time
|
||||
|
Loading…
x
Reference in New Issue
Block a user