Even more metadata for playlists
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user