-- ext is the last extension, LOWERCASED
-- ext2 is the one before last extension LOWERCASED
- local function check_extension(badness_mult, badness_mult2, is_archive)
+ local function check_extension(badness_mult, badness_mult2)
if #parts > 2 then
-- We need to ensure that it is an extension, so we check for its length
-- Check if next-to-last extension is not a number or date
-- Also check for archive bad extension
if is_archive then
if ext2 then
- check_extension(settings['bad_archive_extensions'][ext],
- settings['bad_archive_extensions'][ext2], true)
+ local score1 = settings['bad_archive_extensions'][ext] or
+ settings['bad_extensions'][ext]
+ local score2 = settings['bad_archive_extensions'][ext2] or
+ settings['bad_extensions'][ext2]
+ check_extension(score1, score2)
else
- check_extension(settings['bad_archive_extensions'][ext], nil, true)
+ local score1 = settings['bad_archive_extensions'][ext] or
+ settings['bad_extensions'][ext]
+ check_extension(score1, nil)
end
if settings['archive_extensions'][ext] then
else
if ext2 then
check_extension(settings['bad_extensions'][ext],
- settings['bad_extensions'][ext2], false)
+ settings['bad_extensions'][ext2])
else
- check_extension(settings['bad_extensions'][ext], nil, false)
+ check_extension(settings['bad_extensions'][ext], nil)
end
end