mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Rename interesting files to supported files
This commit is contained in:
@@ -13,7 +13,7 @@ class File
|
||||
# ensures that moving (unless to another device) and renaming the file
|
||||
# preserves the signature, while copying or editing the file changes it.
|
||||
def self.signature(filename) : UInt64
|
||||
return 0u64 unless is_interesting_file filename
|
||||
return 0u64 unless is_supported_file filename
|
||||
info = File.info filename
|
||||
signatures = [
|
||||
info.inode,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
IMGS_PER_PAGE = 5
|
||||
ENTRIES_IN_HOME_SECTIONS = 8
|
||||
UPLOAD_URL_PREFIX = "/uploads"
|
||||
STATIC_DIRS = ["/css", "/js", "/img", "/favicon.ico"]
|
||||
INTERESTING_FILE_EXTNAMES = [".zip", ".cbz", ".rar", ".cbr"]
|
||||
IMGS_PER_PAGE = 5
|
||||
ENTRIES_IN_HOME_SECTIONS = 8
|
||||
UPLOAD_URL_PREFIX = "/uploads"
|
||||
STATIC_DIRS = ["/css", "/js", "/img", "/favicon.ico"]
|
||||
SUPPORTED_FILE_EXTNAMES = [".zip", ".cbz", ".rar", ".cbr"]
|
||||
|
||||
def random_str
|
||||
UUID.random.to_s.gsub "-", ""
|
||||
@@ -32,8 +32,8 @@ def register_mime_types
|
||||
end
|
||||
end
|
||||
|
||||
def is_interesting_file(path)
|
||||
INTERESTING_FILE_EXTNAMES.includes? (File.extname path).downcase
|
||||
def is_supported_file(path)
|
||||
SUPPORTED_FILE_EXTNAMES.includes? File.extname(path).downcase
|
||||
end
|
||||
|
||||
struct Int
|
||||
|
||||
Reference in New Issue
Block a user