diff --git a/source/list/cachedlist.cpp b/source/list/cachedlist.cpp index 00511364..8926e207 100644 --- a/source/list/cachedlist.cpp +++ b/source/list/cachedlist.cpp @@ -14,6 +14,7 @@ void CachedList::Load(string path, string containing) /* Load All bool update_games = false; bool update_homebrew = false; bool update_dml = false; + bool ditimes = false; if(!m_wbfsFS) { update_games = strcasestr(path.c_str(), "wbfs") != NULL && force_update[COVERFLOW_USB]; @@ -24,15 +25,18 @@ void CachedList::Load(string path, string containing) /* Load All if(update_games || update_homebrew || update_dml) remove(m_database.c_str()); - struct stat filestat, cache; + m_discinf = sfmt("%s/disc.info", path.c_str()); + struct stat filestat, discinfo, cache; gprintf("%s\n", path.c_str()); - if(stat(path.c_str(), &filestat) == -1) return; + if(stat(path.c_str(), &filestat) == -1) return; bool update_lang = m_lastLanguage != m_curLanguage; bool noDB = stat(m_database.c_str(), &cache) == -1; bool mtimes = filestat.st_mtime > cache.st_mtime; + if(strcasestr(m_discinf.c_str(), "wbfs") != NULL && stat(m_discinf.c_str(), &discinfo) != -1) + ditimes = discinfo.st_mtime > cache.st_mtime; - m_update = update_lang || noDB || mtimes; + m_update = update_lang || noDB || mtimes || ditimes; if(m_update) gprintf("Cache is being updated because %s\n", update_lang ? "languages are different!" : noDB ? "a database was not found!" : "the WBFS folder was modified!"); } @@ -44,6 +48,7 @@ void CachedList::Load(string path, string containing) /* Load All if(m_update || m_wbfsFS || music) { gprintf("Calling list to update filelist\n"); + safe_vector pathlist; list.GetPaths(pathlist, containing, path, m_wbfsFS); list.GetHeaders(pathlist, *this, m_settingsDir, m_curLanguage); diff --git a/source/list/cachedlist.hpp b/source/list/cachedlist.hpp index a86144e0..c1b39bf4 100644 --- a/source/list/cachedlist.hpp +++ b/source/list/cachedlist.hpp @@ -76,6 +76,7 @@ class CachedList : public safe_vector string m_lastLanguage; string m_channelLang; string m_lastchannelLang; + string m_discinf; }; #endif