From c6d08bb734941b4212e8d6e755e9889c6bfb691f Mon Sep 17 00:00:00 2001 From: fedeanto11 Date: Mon, 6 Feb 2012 12:39:06 +0000 Subject: [PATCH] * Now it's possible download alternative covers Set alternative_cover in GENERAL , on by default. If the alternative it's not on the server wiiflow will download the original one --- source/menu/menu_download.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/source/menu/menu_download.cpp b/source/menu/menu_download.cpp index 266a4fff..0a8e17ab 100644 --- a/source/menu/menu_download.cpp +++ b/source/menu/menu_download.cpp @@ -31,10 +31,15 @@ using namespace std; static const char FMT_BPIC_URL[] = "http://art.gametdb.com/wii/coverfullHQ/{loc}/{gameid}.png"\ -"|http://art.gametdb.com/wii/coverfullHQ2/{loc}/{gameid}.png"\ "|http://art.gametdb.com/wii/coverfull/{loc}/{gameid}.png"; -static const char FMT_PIC_URL[] = "http://art.gametdb.com/wii/cover/{loc}/{gameid}.png"\ -"|http://art.gametdb.com/wii/cover2/{loc}/{gameid}.png"; +static const char FMT_PIC_URL[] = "http://art.gametdb.com/wii/cover/{loc}/{gameid}.png"; + +// If the alternative cover is not on the server, download the original one +static const char FMT_BPIC_URL_ALT[] = "http://art.gametdb.com/wii/coverfullHQ2/{loc}/{gameid}.png"\ +"|http://art.gametdb.com/wii/coverfullHQ/{loc}/{gameid}.png"\ +"|http://art.gametdb.com/wii/coverfull/{loc}/{gameid}.png"; +static const char FMT_PIC_URL_ALT[] = "http://art.gametdb.com/wii/cover2/{loc}/{gameid}.png"\ +"|http://art.gametdb.com/wii/cover/{loc}/{gameid}.png"; static block download = { 0, 0 }; static string countryCode(const string &gameId) @@ -323,8 +328,19 @@ int CMenu::_coverDownloader(bool missingOnly) } bool savePNG = m_cfg.getBool("GENERAL", "keep_png", true); - safe_vector fmtURLBox = stringToVector(m_cfg.getString("GENERAL", "url_full_covers", FMT_BPIC_URL), '|'); - safe_vector fmtURLFlat = stringToVector(m_cfg.getString("GENERAL", "url_flat_covers", FMT_PIC_URL), '|'); + bool alternative_cover = m_cfg.getBool("GENERAL", "alternative_cover", true); + safe_vector fmtURLBox; + safe_vector fmtURLFlat; + if(alternative_cover) + { + fmtURLBox = stringToVector(m_cfg.getString("GENERAL", "url_full_covers", FMT_BPIC_URL_ALT), '|'); + fmtURLFlat = stringToVector(m_cfg.getString("GENERAL", "url_flat_covers", FMT_PIC_URL_ALT), '|'); + } + else + { + fmtURLBox = stringToVector(m_cfg.getString("GENERAL", "url_full_covers", FMT_BPIC_URL), '|'); + fmtURLFlat = stringToVector(m_cfg.getString("GENERAL", "url_flat_covers", FMT_PIC_URL), '|'); + } u32 nbSteps = m_gameList.size(); u32 step = 0;