1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00
This commit is contained in:
nordsoft
2023-09-02 14:10:50 +04:00
parent 4024a44b7e
commit 1ef407ea9f
3 changed files with 11 additions and 1 deletions

View File

@@ -22,6 +22,10 @@
"type" : "string",
"description" : "Author of the mod. Can be nickname, real name or name of team"
},
"size": {
"type" : "number",
"description" : "Approximate size of mod, compressed by zip algorithm, in Mb"
},
"changelog" : {
"type" : "object",
"description" : "List of changes/new features in each version",

View File

@@ -141,6 +141,9 @@ void CDownloadManager::downloadProgressChanged(qint64 bytesReceived, qint64 byte
quint64 received = 0;
for(auto & entry : currentDownloads)
received += entry.bytesReceived > 0 ? entry.bytesReceived : 0;
if(received > total)
total = received;
emit downloadProgress(received, total);
}

View File

@@ -324,9 +324,10 @@ CModEntry CModList::getMod(QString modname) const
{
if(repo.empty() || CModEntry::compareVersions(repo["version"].toString(), repoValMap["version"].toString()))
{
//take valid download link and screenshots before assignment
//take valid download link, screenshots and mod size before assignment
auto download = repo.value("download");
auto screenshots = repo.value("screenshots");
auto size = repo.value("size");
repo = repoValMap;
if(repo.value("download").isNull())
{
@@ -334,6 +335,8 @@ CModEntry CModList::getMod(QString modname) const
if(repo.value("screenshots").isNull()) //taking screenshot from the downloadable version
repo["screenshots"] = screenshots;
}
if(repo.value("size").isNull())
repo["size"] = size;
}
}
}