Logging tracks/albums updates

This commit is contained in:
Deluan 2016-03-11 12:10:37 -05:00
parent a918dc5a14
commit 147a178933

View File

@ -80,6 +80,10 @@ func (i *Importer) lastModifiedSince() time.Time {
beego.Warn("Couldn't read LastScan:", err)
return time.Time{}
}
if ms == "" {
beego.Debug("First scan")
return time.Time{}
}
s, _ := strconv.ParseInt(ms, 10, 64)
return time.Unix(0, s*int64(time.Millisecond))
}
@ -108,6 +112,9 @@ func (i *Importer) importLibrary() (err error) {
if err := i.search.IndexMediaFile(mf); err != nil {
beego.Error("Error indexing artist:", err)
}
if !i.lastScan.IsZero() {
beego.Debug("Updated Track:", mf.Title)
}
}
j = 0
@ -123,6 +130,9 @@ func (i *Importer) importLibrary() (err error) {
if err := i.search.IndexAlbum(al); err != nil {
beego.Error("Error indexing artist:", err)
}
if !i.lastScan.IsZero() {
beego.Debug(fmt.Sprintf(`Updated Album:"%s" from "%s"`, al.Name, al.Artist))
}
}
j = 0