diff --git a/es-app/CMakeLists.txt b/es-app/CMakeLists.txt index 47dfd131c..04cbf509c 100644 --- a/es-app/CMakeLists.txt +++ b/es-app/CMakeLists.txt @@ -30,7 +30,6 @@ set(ES_HEADERS # Scrapers ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.h ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBScraper.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/TheArchiveScraper.h # Views ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.h @@ -77,7 +76,6 @@ set(ES_SOURCES # Scrapers ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBScraper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/TheArchiveScraper.cpp # Views ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.cpp diff --git a/es-app/src/guis/GuiMenu.cpp b/es-app/src/guis/GuiMenu.cpp index d005fc04e..71ac7272b 100644 --- a/es-app/src/guis/GuiMenu.cpp +++ b/es-app/src/guis/GuiMenu.cpp @@ -17,8 +17,6 @@ #include "components/OptionListComponent.h" #include "components/MenuComponent.h" #include "VolumeControl.h" -#include "scrapers/GamesDBScraper.h" -#include "scrapers/TheArchiveScraper.h" GuiMenu::GuiMenu(Window* window) : GuiComponent(window), mMenu(window, "MAIN MENU"), mVersion(window) { diff --git a/es-app/src/scrapers/Scraper.cpp b/es-app/src/scrapers/Scraper.cpp index c827a4755..ff4ba88db 100644 --- a/es-app/src/scrapers/Scraper.cpp +++ b/es-app/src/scrapers/Scraper.cpp @@ -6,11 +6,9 @@ #include #include "GamesDBScraper.h" -#include "TheArchiveScraper.h" const std::map scraper_request_funcs = boost::assign::map_list_of - ("TheGamesDB", &thegamesdb_generate_scraper_requests) - ("TheArchive", &thearchive_generate_scraper_requests); + ("TheGamesDB", &thegamesdb_generate_scraper_requests); std::unique_ptr startScraperSearch(const ScraperSearchParams& params) { diff --git a/es-app/src/scrapers/TheArchiveScraper.cpp b/es-app/src/scrapers/TheArchiveScraper.cpp deleted file mode 100644 index fe490ca55..000000000 --- a/es-app/src/scrapers/TheArchiveScraper.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "TheArchiveScraper.h" -#include "Log.h" -#include "pugixml/pugixml.hpp" - -void thearchive_generate_scraper_requests(const ScraperSearchParams& params, std::queue< std::unique_ptr >& requests, - std::vector& results) -{ - std::string path = "api.archive.vg/2.0/Archive.search/xml/7TTRM4MNTIKR2NNAGASURHJOZJ3QXQC5/"; - - std::string cleanName = params.nameOverride; - if(cleanName.empty()) - cleanName = params.game->getCleanName(); - - path += HttpReq::urlEncode(cleanName); - //platform TODO, should use some params.system get method - - requests.push(std::unique_ptr(new TheArchiveRequest(results, path))); -} - -void TheArchiveRequest::process(const std::unique_ptr& req, std::vector& results) -{ - assert(req->status() == HttpReq::REQ_SUCCESS); - - pugi::xml_document doc; - pugi::xml_parse_result parseResult = doc.load(req->getContent().c_str()); - if(!parseResult) - { - std::stringstream ss; - ss << "TheArchiveRequest - error parsing XML.\n\t" << parseResult.description(); - std::string err = ss.str(); - setError(err); - LOG(LogError) << err; - return; - } - - pugi::xml_node data = doc.child("OpenSearchDescription").child("games"); - - pugi::xml_node game = data.child("game"); - while(game && results.size() < MAX_SCRAPER_RESULTS) - { - ScraperSearchResult result; - - result.mdl.set("name", game.child("title").text().get()); - result.mdl.set("desc", game.child("description").text().get()); - - //Archive.search does not return ratings - - result.mdl.set("developer", game.child("developer").text().get()); - - std::string genre = game.child("genre").text().get(); - size_t search = genre.find_last_of(" > "); - genre = genre.substr(search == std::string::npos ? 0 : search, std::string::npos); - result.mdl.set("genre", genre); - - pugi::xml_node image = game.child("box_front"); - pugi::xml_node thumbnail = game.child("box_front_small"); - - if(image) - result.imageUrl = image.text().get(); - if(thumbnail) - result.thumbnailUrl = thumbnail.text().get(); - - results.push_back(result); - game = game.next_sibling("game"); - } -} diff --git a/es-app/src/scrapers/TheArchiveScraper.h b/es-app/src/scrapers/TheArchiveScraper.h deleted file mode 100644 index 9837539a4..000000000 --- a/es-app/src/scrapers/TheArchiveScraper.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include "scrapers/Scraper.h" - -void thearchive_generate_scraper_requests(const ScraperSearchParams& params, std::queue< std::unique_ptr >& requests, - std::vector& results); - -void thearchive_process_httpreq(const std::unique_ptr& req, std::vector& results); - -class TheArchiveRequest : public ScraperHttpRequest -{ -public: - TheArchiveRequest(std::vector& resultsWrite, const std::string& url) : ScraperHttpRequest(resultsWrite, url) {} -protected: - void process(const std::unique_ptr& req, std::vector& results) override; -}; \ No newline at end of file