forked from Mirrorlandia_minetest/minetest
Use CDB author and name in installed package's config (#8550)
They are used for tracking the package, so should match ContentDB.
This commit is contained in:
parent
f1f9361bc8
commit
4c11574e9d
@ -96,19 +96,16 @@ local function start_install(calling_dialog, package)
|
|||||||
|
|
||||||
if conf_path then
|
if conf_path then
|
||||||
local conf = Settings(conf_path)
|
local conf = Settings(conf_path)
|
||||||
local function set_def(key, value)
|
|
||||||
if conf:get(key) == nil then
|
|
||||||
conf:set(key, value)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if name_is_title then
|
if name_is_title then
|
||||||
set_def("name", result.package.title)
|
conf:set("name", result.package.title)
|
||||||
else
|
else
|
||||||
set_def("title", result.package.title)
|
conf:set("title", result.package.title)
|
||||||
set_def("name", result.package.name)
|
conf:set("name", result.package.name)
|
||||||
end
|
end
|
||||||
set_def("description", result.package.short_description)
|
if not conf:get("description") then
|
||||||
set_def("author", result.package.author)
|
conf:set("description", result.package.short_description)
|
||||||
|
end
|
||||||
|
conf:set("author", result.package.author)
|
||||||
conf:set("release", result.package.release)
|
conf:set("release", result.package.release)
|
||||||
conf:write()
|
conf:write()
|
||||||
end
|
end
|
||||||
@ -299,9 +296,9 @@ function store.load()
|
|||||||
|
|
||||||
local name_len = #package.name
|
local name_len = #package.name
|
||||||
if package.type == "game" and name_len > 5 and package.name:sub(name_len - 4) == "_game" then
|
if package.type == "game" and name_len > 5 and package.name:sub(name_len - 4) == "_game" then
|
||||||
package.id = package.author .. "/" .. package.name:sub(1, name_len - 5)
|
package.id = package.author:lower() .. "/" .. package.name:sub(1, name_len - 5)
|
||||||
else
|
else
|
||||||
package.id = package.author .. "/" .. package.name
|
package.id = package.author:lower() .. "/" .. package.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -317,22 +314,22 @@ function store.update_paths()
|
|||||||
pkgmgr.refresh_globals()
|
pkgmgr.refresh_globals()
|
||||||
for _, mod in pairs(pkgmgr.global_mods:get_list()) do
|
for _, mod in pairs(pkgmgr.global_mods:get_list()) do
|
||||||
if mod.author then
|
if mod.author then
|
||||||
mod_hash[mod.author .. "/" .. mod.name] = mod
|
mod_hash[mod.author:lower() .. "/" .. mod.name] = mod
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local game_hash = {}
|
local game_hash = {}
|
||||||
pkgmgr.update_gamelist()
|
pkgmgr.update_gamelist()
|
||||||
for _, game in pairs(pkgmgr.games) do
|
for _, game in pairs(pkgmgr.games) do
|
||||||
if game.author then
|
if game.author ~= "" then
|
||||||
game_hash[game.author .. "/" .. game.id] = game
|
game_hash[game.author:lower() .. "/" .. game.id] = game
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local txp_hash = {}
|
local txp_hash = {}
|
||||||
for _, txp in pairs(pkgmgr.get_texture_packs()) do
|
for _, txp in pairs(pkgmgr.get_texture_packs()) do
|
||||||
if txp.author then
|
if txp.author then
|
||||||
txp_hash[txp.author .. "/" .. txp.name] = txp
|
txp_hash[txp.author:lower() .. "/" .. txp.name] = txp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user