change: mod metadata improvements
- Use slug instead of name - Keep temporary status before having local details Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -47,12 +47,18 @@ void LocalModUpdateTask::executeTask()
|
||||
auto old_metadata = Metadata::get(m_index_dir, m_mod.addonId);
|
||||
if (old_metadata.isValid()) {
|
||||
emit hasOldMod(old_metadata.name, old_metadata.filename);
|
||||
if (m_mod.slug.isEmpty())
|
||||
m_mod.slug = old_metadata.slug;
|
||||
}
|
||||
|
||||
auto pw_mod = Metadata::create(m_index_dir, m_mod, m_mod_version);
|
||||
Metadata::update(m_index_dir, pw_mod);
|
||||
|
||||
emitSucceeded();
|
||||
if (pw_mod.isValid()) {
|
||||
Metadata::update(m_index_dir, pw_mod);
|
||||
emitSucceeded();
|
||||
} else {
|
||||
qCritical() << "Tried to update an invalid mod!";
|
||||
emitFailed(tr("Invalid metadata"));
|
||||
}
|
||||
}
|
||||
|
||||
auto LocalModUpdateTask::abort() -> bool
|
||||
|
@ -71,7 +71,7 @@ void ModFolderLoadTask::run()
|
||||
|
||||
auto metadata = m_result->mods[chopped_id].metadata();
|
||||
if (metadata) {
|
||||
mod.setMetadata(new Metadata::ModStruct(*metadata));
|
||||
mod.setMetadata(*metadata);
|
||||
|
||||
m_result->mods[mod.internal_id()].setStatus(ModStatus::Installed);
|
||||
m_result->mods.remove(chopped_id);
|
||||
|
Reference in New Issue
Block a user