nordsoft 2 years ago
parent
commit
40ea45498f

+ 1 - 1
config/schemas/mod.json

@@ -22,7 +22,7 @@
 					"type" : "string",
 					"type" : "string",
 					"description" : "Author of the mod. Can be nickname, real name or name of team"
 					"description" : "Author of the mod. Can be nickname, real name or name of team"
 				},
 				},
-				"size": {
+				"downloadSize": {
 					"type" : "number",
 					"type" : "number",
 					"description" : "Approximate size of mod, compressed by zip algorithm, in Mb"
 					"description" : "Approximate size of mod, compressed by zip algorithm, in Mb"
 				},
 				},

+ 3 - 3
launcher/modManager/cmodlist.cpp

@@ -327,7 +327,7 @@ CModEntry CModList::getMod(QString modname) const
 					//take valid download link, screenshots and mod size before assignment
 					//take valid download link, screenshots and mod size before assignment
 					auto download = repo.value("download");
 					auto download = repo.value("download");
 					auto screenshots = repo.value("screenshots");
 					auto screenshots = repo.value("screenshots");
-					auto size = repo.value("size");
+					auto size = repo.value("downloadSize");
 					repo = repoValMap;
 					repo = repoValMap;
 					if(repo.value("download").isNull())
 					if(repo.value("download").isNull())
 					{
 					{
@@ -335,8 +335,8 @@ CModEntry CModList::getMod(QString modname) const
 						if(repo.value("screenshots").isNull()) //taking screenshot from the downloadable version
 						if(repo.value("screenshots").isNull()) //taking screenshot from the downloadable version
 							repo["screenshots"] = screenshots;
 							repo["screenshots"] = screenshots;
 					}
 					}
-					if(repo.value("size").isNull())
-						repo["size"] = size;
+					if(repo.value("downloadSize").isNull())
+						repo["downloadSize"] = size;
 				}
 				}
 			}
 			}
 		}
 		}

+ 6 - 6
launcher/modManager/cmodlistview_moc.cpp

@@ -249,9 +249,9 @@ QString CModListView::genModInfoText(CModEntry & mod)
 	result += replaceIfNotEmpty(mod.getValue("latestVersion"), lineTemplate.arg(tr("Latest version")));
 	result += replaceIfNotEmpty(mod.getValue("latestVersion"), lineTemplate.arg(tr("Latest version")));
 
 
 	if(mod.getValue("localSizeBytes").isValid())
 	if(mod.getValue("localSizeBytes").isValid())
-		result += replaceIfNotEmpty(CModEntry::sizeToString(mod.getValue("localSizeBytes").toDouble()), lineTemplate.arg(tr("Size")));
-	if((mod.isAvailable() || mod.isUpdateable()) && mod.getValue("size").isValid())
-		result += replaceIfNotEmpty(CModEntry::sizeToString(mbToBytes(mod.getValue("size").toDouble())), lineTemplate.arg(tr("Download size")));
+		result += replaceIfNotEmpty(CModEntry::sizeToString(mod.getValue("localSizeBytes").toDouble()), lineTemplate.arg(tr("downloadSize")));
+	if((mod.isAvailable() || mod.isUpdateable()) && mod.getValue("downloadSize").isValid())
+		result += replaceIfNotEmpty(CModEntry::sizeToString(mbToBytes(mod.getValue("downloadSize").toDouble())), lineTemplate.arg(tr("Download size")));
 	
 	
 	result += replaceIfNotEmpty(mod.getValue("author"), lineTemplate.arg(tr("Authors")));
 	result += replaceIfNotEmpty(mod.getValue("author"), lineTemplate.arg(tr("Authors")));
 
 
@@ -543,7 +543,7 @@ void CModListView::on_updateButton_clicked()
 		auto mod = modModel->getMod(name);
 		auto mod = modModel->getMod(name);
 		// update required mod, install missing (can be new dependency)
 		// update required mod, install missing (can be new dependency)
 		if(mod.isUpdateable() || !mod.isInstalled())
 		if(mod.isUpdateable() || !mod.isInstalled())
-			downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("size").toDouble()));
+			downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("downloadSize").toDouble()));
 	}
 	}
 }
 }
 
 
@@ -573,7 +573,7 @@ void CModListView::on_installButton_clicked()
 	{
 	{
 		auto mod = modModel->getMod(name);
 		auto mod = modModel->getMod(name);
 		if(!mod.isInstalled())
 		if(!mod.isInstalled())
-			downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("size").toDouble()));
+			downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("downloadSize").toDouble()));
 	}
 	}
 }
 }
 
 
@@ -863,7 +863,7 @@ void CModListView::doInstallMod(const QString & modName)
 	{
 	{
 		auto mod = modModel->getMod(name);
 		auto mod = modModel->getMod(name);
 		if(!mod.isInstalled())
 		if(!mod.isInstalled())
-			downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("size").toDouble()));
+			downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("downloadSize").toDouble()));
 	}
 	}
 }
 }