diff options
author | rubenwardy <rw@rubenwardy.com> | 2020-06-06 17:59:39 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2020-06-06 18:31:39 +0100 |
commit | 36099ba947e6a54429c9fdd45ef1fc6dcc86389b (patch) | |
tree | 120833d54ba47ff6b5be5f9653c864f6a33597d9 /builtin/mainmenu | |
parent | 60bab8b2d7b61383188c10f5d931dc7b5522d042 (diff) | |
download | minetest-36099ba947e6a54429c9fdd45ef1fc6dcc86389b.tar.gz minetest-36099ba947e6a54429c9fdd45ef1fc6dcc86389b.tar.bz2 minetest-36099ba947e6a54429c9fdd45ef1fc6dcc86389b.zip |
Fix incorrect extension used for ContentDB thumbnails
Diffstat (limited to 'builtin/mainmenu')
-rw-r--r-- | builtin/mainmenu/dlg_contentstore.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/mainmenu/dlg_contentstore.lua b/builtin/mainmenu/dlg_contentstore.lua index ae119f48f..b5c330f8f 100644 --- a/builtin/mainmenu/dlg_contentstore.lua +++ b/builtin/mainmenu/dlg_contentstore.lua @@ -133,6 +133,11 @@ local function start_install(calling_dialog, package) end end +local function get_file_extension(path) + local parts = path:split(".") + return parts[#parts] +end + local function get_screenshot(package) if not package.thumbnail then return defaulttexturedir .. "no_screenshot.png" @@ -141,8 +146,9 @@ local function get_screenshot(package) end -- Get tmp screenshot path + local ext = get_file_extension(package.thumbnail) 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 local file = io.open(filepath, "r") |