Apply format validation even when caching is disabled

This commit is contained in:
Seednode 2023-09-14 22:39:51 -05:00
parent 5ab6d1ee85
commit 76b4053240
2 changed files with 7 additions and 7 deletions

View File

@ -99,8 +99,10 @@ func preparePath(path string) string {
return mediaPrefix + path return mediaPrefix + path
} }
func appendPath(directory, path string, files *files, stats *scanStats, formats *types.Types, shouldCache bool) { func appendPath(directory, path string, files *files, stats *scanStats, formats *types.Types) {
if shouldCache && !formats.Validate(path) { if !formats.Validate(path) {
stats.filesSkipped.Add(1)
return return
} }
@ -110,8 +112,6 @@ func appendPath(directory, path string, files *files, stats *scanStats, formats
} }
func appendPaths(path string, files *files, filters *filters, stats *scanStats, formats *types.Types) error { func appendPaths(path string, files *files, filters *filters, stats *scanStats, formats *types.Types) error {
shouldCache := Cache && filters.isEmpty()
absolutePath, err := filepath.Abs(path) absolutePath, err := filepath.Abs(path)
if err != nil { if err != nil {
return err return err
@ -140,7 +140,7 @@ func appendPaths(path string, files *files, filters *filters, stats *scanStats,
filename, filename,
filters.included[i], filters.included[i],
) { ) {
appendPath(directory, path, files, stats, formats, shouldCache) appendPath(directory, path, files, stats, formats)
return nil return nil
} }
@ -151,7 +151,7 @@ func appendPaths(path string, files *files, filters *filters, stats *scanStats,
return nil return nil
} }
appendPath(directory, path, files, stats, formats, shouldCache) appendPath(directory, path, files, stats, formats)
return nil return nil
} }

View File

@ -11,7 +11,7 @@ import (
) )
const ( const (
ReleaseVersion string = "0.85.0" ReleaseVersion string = "0.85.1"
) )
var ( var (