Option to ignore folder playlists

This commit is contained in:
Deluan 2016-03-09 19:06:50 -05:00
parent deb8b32211
commit a4e9d9da14
2 changed files with 6 additions and 3 deletions

View File

@ -14,6 +14,7 @@ user=deluan
password=wordpass
dbPath=./devDb
downsampleCommand=ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -
ignorePlsFolders = true
[dev]
disableValidation = true

View File

@ -55,7 +55,12 @@ func (s *ItunesScanner) ScanLibrary(lastModifiedSince time.Time, path string) (i
}
}
ignFolders, _ := beego.AppConfig.Bool("ignorePlsFolders")
for _, p := range l.Playlists {
if p.Master || p.Music || (ignFolders && p.Folder) {
continue
}
s.collectPlaylists(&p)
}
beego.Debug("Processed", len(l.Playlists), "playlists.")
@ -77,9 +82,6 @@ func (s *ItunesScanner) Playlists() map[string]*domain.Playlist {
}
func (s *ItunesScanner) collectPlaylists(p *itl.Playlist) {
if p.Master || p.Music {
return
}
pl := &domain.Playlist{}
pl.Id = strconv.Itoa(p.PlaylistID)
pl.Name = p.Name