Added Genre and Track Number to getMusicDirectory

This commit is contained in:
Deluan
2016-03-02 22:43:31 -05:00
parent 838d4bf38f
commit 51bae19191
6 changed files with 11 additions and 0 deletions
+2
View File
@@ -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
+3
View File
@@ -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{
+2
View File
@@ -11,6 +11,8 @@ type Track struct {
Album string
Artist string
AlbumArtist string
Genre string
TrackNumber int
Year int
Compilation bool
CreatedAt time.Time