mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 02:45:29 -04:00
Replace to is_valid?
This commit is contained in:
parent
8e4bb995d3
commit
9ce8e918f0
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user