Properly add slash check and fix JPN Lang selection.

This commit is contained in:
StackZ
2020-10-30 19:16:37 +01:00
parent b7fa9c2ba5
commit 6aec8dac77
4 changed files with 38 additions and 21 deletions
+5 -1
View File
@@ -110,7 +110,7 @@ std::vector<std::string> getContents(const std::string &name, const std::vector<
const std::string &fieName: Const Reference to the filename, without path.
*/
UniStoreInfo GetInfo(const std::string &file, const std::string &fileName) {
UniStoreInfo Temp = { "", "", "", fileName, "", -1, -1, -1 }; // Title, Author, URL, FileName, Desc, Version, Revision, Entries.
UniStoreInfo Temp = { "", "", "", "", fileName, "", -1, -1, -1 }; // Title, Author, URL, File (to check if no slash exist), FileName, Desc, Version, Revision, Entries.
nlohmann::json JSON = nullptr;
FILE *temp = fopen(file.c_str(), "r");
@@ -123,6 +123,10 @@ UniStoreInfo GetInfo(const std::string &file, const std::string &fileName) {
Temp.Title = JSON["storeInfo"]["title"];
}
if (JSON["storeInfo"].contains("file") && JSON["storeInfo"]["file"].is_string()) {
Temp.File = JSON["storeInfo"]["file"];
}
if (JSON["storeInfo"].contains("author") && JSON["storeInfo"]["author"].is_string()) {
Temp.Author = JSON["storeInfo"]["author"];
}