mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-15 20:03:15 +02:00
Fixes
This commit is contained in:
@@ -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",
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user