From b23c9ed27db1e8533a2a3d0afd352c39d4adca3f Mon Sep 17 00:00:00 2001 From: Sude Date: Sun, 7 Sep 2014 23:53:26 +0300 Subject: [PATCH] Only list games that support the platforms specified with --platform --- src/downloader.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/downloader.cpp b/src/downloader.cpp index b660c0c..70f4c61 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -1966,6 +1966,20 @@ std::vector Downloader::getGames() // Game name is contained in data-gameindex attribute game.name = it->attribute("data-gameindex").second; game.id = it->attribute("data-gameid").second; + + // Get platform info + std::string tags = it->attribute("data-title").second; + unsigned int platform = GlobalConstants::PLATFORM_WINDOWS; // The tags don't specify Windows support so assume that there's always a Windows version + + if (tags.find("linux") != std::string::npos) + platform |= GlobalConstants::PLATFORM_LINUX; + if (tags.find("osx mac") != std::string::npos) + platform |= GlobalConstants::PLATFORM_MAC; + + // Skip if platform doesn't match + if (!(platform & config.iInstallerType)) + continue; + if (!game.name.empty() && !game.id.empty()) { // Check for DLC