Better logging in scanner/importer

This commit is contained in:
Deluan 2016-03-06 20:42:53 -05:00
parent 76deb2f5bb
commit be28ce1178
2 changed files with 2 additions and 2 deletions

View File

@ -47,12 +47,10 @@ type Importer struct {
}
func (i *Importer) Run() {
beego.Info("Starting iTunes import from:", i.mediaFolder)
if total, err := i.scanner.ScanLibrary(i.mediaFolder); err != nil {
beego.Error("Error importing iTunes Library:", err)
return
} else {
//fmt.Printf(">>>>>>>>>>>>>>>>>>\n%#v\n>>>>>>>>>>>>>>>>>\n", i.scanner.Albums())
beego.Info("Found", total, "tracks,",
len(i.scanner.MediaFiles()), "songs,",
len(i.scanner.Albums()), "albums,",

View File

@ -21,11 +21,13 @@ type ItunesScanner struct {
}
func (s *ItunesScanner) ScanLibrary(path string) (int, error) {
beego.Info("Starting iTunes import from:", path)
xml, _ := os.Open(path)
l, err := itl.ReadFromXML(xml)
if err != nil {
return 0, err
}
beego.Info("Loaded", len(l.Tracks), "tracks")
s.mediaFiles = make(map[string]*domain.MediaFile)
s.albums = make(map[string]*domain.Album)