-added new option to wiiflow.ini, "skip_list_check", if you enable

it wiiflow will not check for new games on boot, that will speed up
bootup amazingly for people with alot of wii games (disabled by def)
-disabled extended list check by default
This commit is contained in:
fix94.1 2012-08-22 05:21:15 +00:00
parent 14d4efe478
commit eba8ab8398
3 changed files with 28 additions and 26 deletions

View File

@ -35,24 +35,24 @@ void CachedList::Load(string path, string containing, string m_lastLanguage, Con
gprintf("%s\n", path.c_str()); gprintf("%s\n", path.c_str());
if(stat(path.c_str(), &filestat) == -1) if(stat(path.c_str(), &filestat) == -1)
return; return;
bool update_lang = m_lastLanguage != m_curLanguage; bool update_lang = m_lastLanguage != m_curLanguage;
bool noDB = stat(m_database.c_str(), &cache) == -1; bool noDB = stat(m_database.c_str(), &cache) == -1;
bool mtimes = filestat.st_mtime > cache.st_mtime; bool mtimes = filestat.st_mtime > cache.st_mtime;
if(strcasestr(m_discinf.c_str(), "wbfs") != NULL && stat(m_discinf.c_str(), &discinfo) != -1) if(strcasestr(m_discinf.c_str(), "wbfs") != NULL && stat(m_discinf.c_str(), &discinfo) != -1)
ditimes = discinfo.st_mtime > cache.st_mtime; ditimes = discinfo.st_mtime > cache.st_mtime;
m_update = update_lang || noDB || mtimes || ditimes; m_update = update_lang || noDB || (!m_skipcheck && (mtimes || ditimes));
if(m_update) if(m_update)
gprintf("Cache of %s is being updated because:\n", path.c_str()); gprintf("Cache of %s is being updated because:\n", path.c_str());
if(update_lang) if(update_lang)
gprintf("Languages are different!\nOld language string: %s\nNew language string: %s\n", m_lastLanguage.c_str(), m_curLanguage.c_str()); gprintf("Languages are different!\nOld language string: %s\nNew language string: %s\n", m_lastLanguage.c_str(), m_curLanguage.c_str());
if(noDB) if(noDB)
gprintf("A database was not found!\n"); gprintf("A database was not found!\n");
if(mtimes || ditimes) if(!m_skipcheck && (mtimes || ditimes))
gprintf("The WBFS folder was modified!\nCache date: %i\nFolder date: %i\n", cache.st_mtime, filestat.st_mtime); gprintf("The WBFS folder was modified!\nCache date: %i\nFolder date: %i\n", cache.st_mtime, filestat.st_mtime);
if(m_extcheck && !m_update) if(m_extcheck && !m_update && !m_skipcheck)
{ {
bool m_chupdate = false; bool m_chupdate = false;
DIR *dir = opendir(path.c_str()); DIR *dir = opendir(path.c_str());
@ -66,7 +66,7 @@ void CachedList::Load(string path, string containing, string m_lastLanguage, Con
break; break;
} }
m_update = m_chupdate; m_update = m_chupdate;
} }
} }
if(update_games) if(update_games)

View File

@ -19,8 +19,8 @@ enum {
class CachedList : public vector<dir_discHdr> class CachedList : public vector<dir_discHdr>
{ {
public: public:
void Init(string cachedir, string settingsDir, string curLanguage, string DMLgameDir, bool extcheck) /* Initialize Private Variables */ void Init(string cachedir, string settingsDir, string curLanguage, string DMLgameDir, bool extcheck, bool skipcheck) /* Initialize Private Variables */
{ {
m_cacheDir = cachedir; m_cacheDir = cachedir;
m_settingsDir = settingsDir; m_settingsDir = settingsDir;
@ -29,6 +29,7 @@ class CachedList : public vector<dir_discHdr>
m_database = ""; m_database = "";
m_update = false; m_update = false;
m_extcheck = extcheck; m_extcheck = extcheck;
m_skipcheck = skipcheck;
m_DMLgameDir = DMLgameDir; m_DMLgameDir = DMLgameDir;
for(u32 i = 0; i < COVERFLOW_MAX; i++) for(u32 i = 0; i < COVERFLOW_MAX; i++)
force_update[i] = false; force_update[i] = false;
@ -49,30 +50,31 @@ class CachedList : public vector<dir_discHdr>
} }
} }
void Load(string path, string containing, string m_lastLanguage, Config &m_plugin); void Load(string path, string containing, string m_lastLanguage, Config &m_plugin);
void LoadChannels(string path, u32 channelType, string m_lastLanguage); void LoadChannels(string path, u32 channelType, string m_lastLanguage);
void Unload(){if(m_loaded) {this->clear(); m_loaded = false; m_database = "";}}; void Unload(){if(m_loaded) {this->clear(); m_loaded = false; m_database = "";}};
void Save() {if(m_loaded) CCache(*this, m_database, SAVE);} /* Save All */ void Save() {if(m_loaded) CCache(*this, m_database, SAVE);} /* Save All */
void Get(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, LOAD);} /* Load One */ void Get(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, LOAD);} /* Load One */
void Set(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, SAVE);} /* Save One */ void Set(dir_discHdr tmp, u32 index) {if(m_loaded) CCache(tmp, m_database, index, SAVE);} /* Save One */
void Add(dir_discHdr tmp) {if(m_loaded) CCache(*this, m_database, tmp, ADD);} /* Add One */
void Remove(u32 index) {if(m_loaded) CCache(*this, m_database, index, REMOVE);} /* Remove One */
void Add(dir_discHdr tmp) {if(m_loaded) CCache(*this, m_database, tmp, ADD);} /* Add One */
void Remove(u32 index) {if(m_loaded) CCache(*this, m_database, index, REMOVE);} /* Remove One */
void SetLanguage(string curLanguage) { m_curLanguage = curLanguage; } void SetLanguage(string curLanguage) { m_curLanguage = curLanguage; }
private: private:
string make_db_name(string path); string make_db_name(string path);
bool m_loaded; bool m_loaded;
bool m_update; bool m_update;
bool m_wbfsFS; bool m_wbfsFS;
bool m_extcheck; bool m_extcheck;
bool m_skipcheck;
u8 force_update[COVERFLOW_MAX]; u8 force_update[COVERFLOW_MAX];
CList<dir_discHdr> list; CList<dir_discHdr> list;
string m_database; string m_database;
string m_cacheDir; string m_cacheDir;
string m_settingsDir; string m_settingsDir;
string m_curLanguage; string m_curLanguage;
string m_lastLanguage; string m_lastLanguage;

View File

@ -416,11 +416,11 @@ void CMenu::init(void)
m_curLanguage = CMenu::_translations[0]; m_curLanguage = CMenu::_translations[0];
m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str())); m_loc.load(fmt("%s/%s.ini", m_languagesDir.c_str(), m_curLanguage.c_str()));
} }
bool extcheck = m_cfg.getBool("GENERAL", "extended_list_check", false);
bool extcheck = m_cfg.getBool("GENERAL", "extended_list_check", true); bool skipcheck = m_cfg.getBool("GENERAL", "skip_list_check", false);
m_tempView = false; m_tempView = false;
m_gameList.Init(m_listCacheDir, m_settingsDir, m_loc.getString(m_curLanguage, "gametdb_code", "EN"), m_DMLgameDir, extcheck); m_gameList.Init(m_listCacheDir, m_settingsDir, m_loc.getString(m_curLanguage, "gametdb_code", "EN"), m_DMLgameDir, extcheck, skipcheck);
m_aa = 3; m_aa = 3;