mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-06 10:15:19 +01:00
Update to new ContentDB API
This commit is contained in:
@@ -43,24 +43,19 @@ std::vector<Package> getPackagesFromURL(const std::string &url)
|
||||
for (unsigned int i = 0; i < json.size(); ++i) {
|
||||
Package package;
|
||||
|
||||
package.author = json[i]["author"].asString();
|
||||
package.name = json[i]["name"].asString();
|
||||
package.title = json[i]["title"].asString();
|
||||
package.author = json[i]["author"].asString();
|
||||
package.type = json[i]["type"].asString();
|
||||
package.shortDesc = json[i]["shortDesc"].asString();
|
||||
package.url = json[i]["url"].asString();
|
||||
package.release = json[i]["release"].asInt();
|
||||
if (json[i].isMember("thumbnail"))
|
||||
package.thumbnail = json[i]["thumbnail"].asString();
|
||||
|
||||
Json::Value jScreenshots = json[i]["screenshots"];
|
||||
for (unsigned int j = 0; j < jScreenshots.size(); ++j) {
|
||||
package.screenshots.push_back(jScreenshots[j].asString());
|
||||
}
|
||||
|
||||
if (package.valid()) {
|
||||
if (package.valid())
|
||||
packages.push_back(package);
|
||||
} else {
|
||||
else
|
||||
errorstream << "Invalid package at " << i << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
return packages;
|
||||
|
||||
Reference in New Issue
Block a user