mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Treat tarball archives in patch nodes as installers
This commit is contained in:
parent
01d8479d18
commit
6ed5da2fb3
68
src/api.cpp
68
src/api.cpp
@ -420,15 +420,31 @@ gameDetails API::getGameDetails(const std::string& game_name, const unsigned int
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
game.patches.push_back(
|
// Treat tarball archives as installers
|
||||||
gameFile( false, /* patches don't have "updated" flag */
|
if (patch["link"].asString().find("/linux/") != std::string::npos && patch["name"].asString() == "Tarball archive")
|
||||||
patch["id"].isInt() ? std::to_string(patch["id"].asInt()) : patch["id"].asString(),
|
{
|
||||||
patch["name"].asString(),
|
game.installers.push_back(
|
||||||
patch["link"].asString(),
|
gameFile( patch["notificated"].isInt() ? patch["notificated"].asInt() : std::stoi(patch["notificated"].asString()),
|
||||||
patch["size"].asString(),
|
patch["id"].isInt() ? std::to_string(patch["id"].asInt()) : patch["id"].asString(),
|
||||||
GlobalConstants::LANGUAGES[i].languageId
|
patch["name"].asString(),
|
||||||
)
|
patch["link"].asString(),
|
||||||
);
|
patch["size"].asString(),
|
||||||
|
GlobalConstants::LANGUAGES[i].languageId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
game.patches.push_back(
|
||||||
|
gameFile( false, /* patches don't have "updated" flag */
|
||||||
|
patch["id"].isInt() ? std::to_string(patch["id"].asInt()) : patch["id"].asString(),
|
||||||
|
patch["name"].asString(),
|
||||||
|
patch["link"].asString(),
|
||||||
|
patch["size"].asString(),
|
||||||
|
GlobalConstants::LANGUAGES[i].languageId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Patch is a single file
|
else // Patch is a single file
|
||||||
@ -450,15 +466,31 @@ gameDetails API::getGameDetails(const std::string& game_name, const unsigned int
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
game.patches.push_back(
|
// Treat tarball archives as installers
|
||||||
gameFile( false, /* patches don't have "updated" flag */
|
if (patchnode["link"].asString().find("/linux/") != std::string::npos && patchnode["name"].asString() == "Tarball archive")
|
||||||
patchnode["id"].isInt() ? std::to_string(patchnode["id"].asInt()) : patchnode["id"].asString(),
|
{
|
||||||
patchnode["name"].asString(),
|
game.installers.push_back(
|
||||||
patchnode["link"].asString(),
|
gameFile( patchnode["notificated"].isInt() ? patchnode["notificated"].asInt() : std::stoi(patchnode["notificated"].asString()),
|
||||||
patchnode["size"].asString(),
|
patchnode["id"].isInt() ? std::to_string(patchnode["id"].asInt()) : patchnode["id"].asString(),
|
||||||
GlobalConstants::LANGUAGES[i].languageId
|
patchnode["name"].asString(),
|
||||||
)
|
patchnode["link"].asString(),
|
||||||
);
|
patchnode["size"].asString(),
|
||||||
|
GlobalConstants::LANGUAGES[i].languageId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
game.patches.push_back(
|
||||||
|
gameFile( false, /* patches don't have "updated" flag */
|
||||||
|
patchnode["id"].isInt() ? std::to_string(patchnode["id"].asInt()) : patchnode["id"].asString(),
|
||||||
|
patchnode["name"].asString(),
|
||||||
|
patchnode["link"].asString(),
|
||||||
|
patchnode["size"].asString(),
|
||||||
|
GlobalConstants::LANGUAGES[i].languageId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user