Fix incorrect extension used for ContentDB thumbnails

This commit is contained in:
rubenwardy 2020-06-06 17:59:39 +01:00
parent 60bab8b2d7
commit 36099ba947

@ -133,6 +133,11 @@ local function start_install(calling_dialog, package)
end end
end end
local function get_file_extension(path)
local parts = path:split(".")
return parts[#parts]
end
local function get_screenshot(package) local function get_screenshot(package)
if not package.thumbnail then if not package.thumbnail then
return defaulttexturedir .. "no_screenshot.png" return defaulttexturedir .. "no_screenshot.png"
@ -141,8 +146,9 @@ local function get_screenshot(package)
end end
-- Get tmp screenshot path -- Get tmp screenshot path
local ext = get_file_extension(package.thumbnail)
local filepath = screenshot_dir .. DIR_DELIM .. local filepath = screenshot_dir .. DIR_DELIM ..
package.type .. "-" .. package.author .. "-" .. package.name .. ".png" ("%s-%s-%s.%s"):format(package.type, package.author, package.name, ext)
-- Return if already downloaded -- Return if already downloaded
local file = io.open(filepath, "r") local file = io.open(filepath, "r")