add some comments to scanner

This commit is contained in:
sentriz
2019-07-03 11:41:26 +01:00
parent 7842600e43
commit ada62d1511

View File

@@ -210,11 +210,14 @@ func (s *Scanner) callbackItem(fullPath string, info *godirwalk.Dirent) error {
} }
func (s *Scanner) callbackPost(fullPath string, info *godirwalk.Dirent) error { func (s *Scanner) callbackPost(fullPath string, info *godirwalk.Dirent) error {
// begin taking the current folder if the stack and add it's
// parent, cover that we found, etc.
folder := s.curFolders.Pop() folder := s.curFolders.Pop()
if folder.ReceivedPaths { if folder.ReceivedPaths {
folder.ParentID = s.curFolders.PeekID() folder.ParentID = s.curFolders.PeekID()
folder.Cover = s.curCover folder.Cover = s.curCover
s.tx.Save(folder) s.tx.Save(folder)
// we only log changed folders
log.Printf("processed folder `%s`\n", log.Printf("processed folder `%s`\n",
path.Join(folder.LeftPath, folder.RightPath)) path.Join(folder.LeftPath, folder.RightPath))
} }