Even more metadata for playlists

This commit is contained in:
Deluan
2016-03-21 12:26:55 -04:00
parent 3cefc321b8
commit a9d7d4d242
6 changed files with 37 additions and 14 deletions
+2
View File
@@ -199,6 +199,8 @@ func (i *Importer) importLibrary() (err error) {
j = 0
for _, pl := range i.scanner.Playlists() {
pl.Public = true
pl.Owner = beego.AppConfig.String("user")
pls[j] = *pl
j++
if err := i.plsRepo.Put(pl); err != nil {
+2 -1
View File
@@ -150,8 +150,9 @@ func (s *ItunesScanner) collectPlaylists(p *itl.Playlist, fullPath string) {
pl.Tracks = make([]string, 0, len(p.PlaylistItems))
for _, item := range p.PlaylistItems {
id := strconv.Itoa(item.TrackID)
if _, found := s.mediaFiles[id]; found {
if mf, found := s.mediaFiles[id]; found {
pl.Tracks = append(pl.Tracks, id)
pl.Duration += mf.Duration
}
}
if len(pl.Tracks) > 0 {