From 84384da8d1ffeb798bc2932e87ada68ff5a6bc49 Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 30 Oct 2020 13:14:53 -0400 Subject: [PATCH] Better naming for function --- scanner/tag_scanner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scanner/tag_scanner.go b/scanner/tag_scanner.go index 9d878b328..7e4fda339 100644 --- a/scanner/tag_scanner.go +++ b/scanner/tag_scanner.go @@ -88,7 +88,7 @@ func (s *TagScanner) Scan(ctx context.Context, lastModifiedSince time.Time) erro } allFSDirs[folderStats.Path] = folderStats - if s.isChangedDirs(ctx, folderStats, allDBDirs, lastModifiedSince) { + if s.folderHasChanged(ctx, folderStats, allDBDirs, lastModifiedSince) { changedDirs = append(changedDirs, folderStats.Path) log.Debug("Processing changed folder", "dir", folderStats.Path) err := s.processChangedDir(ctx, folderStats.Path) @@ -174,7 +174,7 @@ func (s *TagScanner) getDBDirTree(ctx context.Context) (map[string]struct{}, err return resp, nil } -func (s *TagScanner) isChangedDirs(ctx context.Context, folder dirStats, dbDirs map[string]struct{}, lastModified time.Time) bool { +func (s *TagScanner) folderHasChanged(ctx context.Context, folder dirStats, dbDirs map[string]struct{}, lastModified time.Time) bool { _, inDB := dbDirs[folder.Path] // If is a new folder with at least one song OR it was modified after lastModified return (!inDB && (folder.AudioFilesCount > 0)) || folder.ModTime.After(lastModified)