Replace to is_valid?

This commit is contained in:
Leeingnyo 2022-06-04 00:19:14 +09:00
parent 8e4bb995d3
commit 9ce8e918f0

View File

@ -19,7 +19,7 @@ class File
# information as long as the above changes do not happen together with # information as long as the above changes do not happen together with
# a file/folder rename, with no library scan in between. # a file/folder rename, with no library scan in between.
def self.signature(filename) : UInt64 def self.signature(filename) : UInt64
if is_supported_file(filename) || is_supported_image_file(filename) if ArchiveEntry.is_valid?(filename) || is_supported_image_file(filename)
File.info(filename).inode File.info(filename).inode
else else
0u64 0u64
@ -64,13 +64,11 @@ 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
if DirEntry.is_valid? path signatures << fn if DirEntry.is_valid? path
signatures << fn
end
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 is_supported_file fn signatures << fn if ArchiveEntry.is_valid? fn
end end
Fiber.yield Fiber.yield
end end