Merge pull request #315 from Leeingnyo/fix/rescan-when-files-added

Fix Dir.contents_signature to detect valid image files
This commit is contained in:
Alex Ling 2022-07-03 15:59:49 +08:00 committed by GitHub
commit e7c4123dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,11 +64,12 @@ class Dir
path = File.join dirname, fn path = File.join dirname, fn
if File.directory? path if File.directory? path
signatures << Dir.contents_signature path, cache signatures << Dir.contents_signature path, cache
signatures << fn if DirEntry.is_valid? path
else else
# Only add its signature value to `signatures` when it is a # Only add its signature value to `signatures` when it is a
# supported file # supported file
signatures << fn if ArchiveEntry.is_valid? fn if ArchiveEntry.is_valid?(fn) || is_supported_image_file(fn)
signatures << fn
end
end end
Fiber.yield Fiber.yield
end end