mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2025-02-02 05:52:31 +01:00
Partially revert "Add language to installer path if it is missing"
Reverts some changes from 97e948abb4d277da3b57f85c65befe2ebb3f04dd. Revert automatically adding the language code to filename: http://gog.com/forum/general/introducing_the_beta_release_of_the_new_gogcom_downloader/post1483 Keep language in gameFile class because it may be useful later.
This commit is contained in:
parent
3131b00589
commit
e2253ebeca
@ -59,7 +59,6 @@ class Downloader
|
|||||||
int downloadCovers(std::string gamename, std::string directory, std::string cover_xml_data);
|
int downloadCovers(std::string gamename, std::string directory, std::string cover_xml_data);
|
||||||
int login();
|
int login();
|
||||||
int getGameDetails();
|
int getGameDetails();
|
||||||
void fixInstallerLanguagePath(gameDetails& game);
|
|
||||||
void getGameList();
|
void getGameList();
|
||||||
size_t getResumePosition();
|
size_t getResumePosition();
|
||||||
CURLcode beginDownload();
|
CURLcode beginDownload();
|
||||||
|
@ -229,7 +229,6 @@ int Downloader::getGameDetails()
|
|||||||
game = gogAPI->getGameDetails(gameNames[i], config.iInstallerType, config.iInstallerLanguage);
|
game = gogAPI->getGameDetails(gameNames[i], config.iInstallerType, config.iInstallerLanguage);
|
||||||
if (!gogAPI->getError())
|
if (!gogAPI->getError())
|
||||||
{
|
{
|
||||||
this->fixInstallerLanguagePath(game);
|
|
||||||
if (!config.bUpdateCheck)
|
if (!config.bUpdateCheck)
|
||||||
games.push_back(game);
|
games.push_back(game);
|
||||||
else
|
else
|
||||||
@ -260,34 +259,6 @@ int Downloader::getGameDetails()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds language to installer path if it is missing
|
|
||||||
void Downloader::fixInstallerLanguagePath(gameDetails& game)
|
|
||||||
{
|
|
||||||
for (unsigned int i = 0; i < game.installers.size(); ++i)
|
|
||||||
{
|
|
||||||
if (game.installers[i].language != GlobalConstants::LANGUAGE_EN)
|
|
||||||
{
|
|
||||||
std::string lang;
|
|
||||||
for (unsigned int j = 0; j < GlobalConstants::LANGUAGES.size(); ++j)
|
|
||||||
{
|
|
||||||
if (game.installers[i].language == GlobalConstants::LANGUAGES[j].languageId)
|
|
||||||
{
|
|
||||||
lang = "_" + GlobalConstants::LANGUAGES[j].languageCode + "_";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boost::match_results<std::string::const_iterator> what;
|
|
||||||
boost::regex expression(lang, boost::regex::perl | boost::regex::icase);
|
|
||||||
if (!boost::regex_search(game.installers[i].path, what, expression))
|
|
||||||
{
|
|
||||||
boost::regex expression("(.*)_(\\d+\\.\\d+.*$)", boost::regex::perl | boost::regex::icase);
|
|
||||||
boost::regex_search(game.installers[i].path,what,expression);
|
|
||||||
game.installers[i].path = what[1] + lang + what[2];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Downloader::listGames()
|
void Downloader::listGames()
|
||||||
{
|
{
|
||||||
if (config.bListDetails) // Detailed list
|
if (config.bListDetails) // Detailed list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user