-updated cache system for plugins, it now wont use folder names

for the db files but its plugin magic to prevent double entries
because of same paths for alternative plugins
-removed some annoying debug prints yet again
This commit is contained in:
fix94.1 2012-10-02 19:26:50 +00:00
parent dd50c080a2
commit f6e7fd2332
2 changed files with 12 additions and 12 deletions

View File

@ -74,13 +74,13 @@ bool GameTDB::OpenFile(const char *filepath)
if(!filepath) if(!filepath)
return false; return false;
gprintf("Trying to open '%s'...", filepath); //gprintf("Trying to open '%s'...", filepath);
file = fopen(filepath, "rb"); file = fopen(filepath, "rb");
if(file) if(file)
{ {
this->filepath = filepath; this->filepath = filepath;
gprintf("success\n"); //gprintf("success\n");
int pos; int pos;
string OffsetsPath = filepath; string OffsetsPath = filepath;
@ -89,7 +89,7 @@ bool GameTDB::OpenFile(const char *filepath)
else else
OffsetsPath.clear(); //! Relative path OffsetsPath.clear(); //! Relative path
gprintf("Checking game offsets\n"); //gprintf("Checking game offsets\n");
LoadGameOffsets(OffsetsPath.c_str()); LoadGameOffsets(OffsetsPath.c_str());
/*if (!isParsed) /*if (!isParsed)
{ {
@ -97,7 +97,7 @@ bool GameTDB::OpenFile(const char *filepath)
CheckTitlesIni(OffsetsPath.c_str()); CheckTitlesIni(OffsetsPath.c_str());
}*/ }*/
} }
else gprintf("failed\n"); //else gprintf("failed\n");
isLoaded = (file != NULL); isLoaded = (file != NULL);
return isLoaded; return isLoaded;
@ -1024,7 +1024,7 @@ int GameTDB::GetCaseVersions(const char *id)
char *data = GetGameNode(id); char *data = GetGameNode(id);
if(!data) if(!data)
{ {
gprintf("GameTDB: GameNode for %s not found\n", id); //gprintf("GameTDB: GameNode for %s not found\n", id);
return altcase; return altcase;
} }

View File

@ -3,10 +3,13 @@
void CachedList::Load(string path, string containing, string m_lastLanguage, Config &m_plugin) /* Load All */ void CachedList::Load(string path, string containing, string m_lastLanguage, Config &m_plugin) /* Load All */
{ {
const char* partition = DeviceName[DeviceHandle.PathToDriveType(path.c_str())];
//gprintf("\nLoading files containing %s in %s\n", containing.c_str(), path.c_str()); //gprintf("\nLoading files containing %s in %s\n", containing.c_str(), path.c_str());
m_loaded = false; m_loaded = false;
m_database = sfmt("%s/%s.db", m_cacheDir.c_str(), (make_db_name(path)).c_str()); if(m_plugin.loaded())
m_database = sfmt("%s/%s_%s.db", m_cacheDir.c_str(), partition, lowerCase(m_plugin.getString("PLUGIN","magic")).c_str());
else
m_database = sfmt("%s/%s.db", m_cacheDir.c_str(), (make_db_name(path)).c_str());
m_wbfsFS = strncasecmp(DeviceHandle.PathToFSName(path.c_str()), "WBFS", 4) == 0; m_wbfsFS = strncasecmp(DeviceHandle.PathToFSName(path.c_str()), "WBFS", 4) == 0;
bool update_games = false; bool update_games = false;
@ -18,12 +21,9 @@ void CachedList::Load(string path, string containing, string m_lastLanguage, Con
if(!m_wbfsFS) if(!m_wbfsFS)
{ {
//gprintf("Database file: %s\n", m_database.c_str()); //gprintf("Database file: %s\n", m_database.c_str());
update_games = strcasestr(path.c_str(), "wbfs") != NULL && force_update[COVERFLOW_USB]; update_games = strcasestr(path.c_str(), "wbfs") != NULL && force_update[COVERFLOW_USB];
update_homebrew = strcasestr(path.c_str(), "apps") != NULL && force_update[COVERFLOW_HOMEBREW]; update_homebrew = strcasestr(path.c_str(), "apps") != NULL && force_update[COVERFLOW_HOMEBREW];
update_emu = strcasestr(path.c_str(), m_plugin.getString("PLUGIN","romDir","").c_str()) != NULL && force_update[COVERFLOW_EMU]; update_emu = m_plugin.loaded() && force_update[COVERFLOW_EMU];
const char* partition = DeviceName[DeviceHandle.PathToDriveType(path.c_str())];
update_dml = strcasestr(path.c_str(), fmt(strncmp(partition, "sd", 2) != 0 ? m_DMLgameDir.c_str() : "%s:/games", partition)) != NULL && force_update[COVERFLOW_DML]; update_dml = strcasestr(path.c_str(), fmt(strncmp(partition, "sd", 2) != 0 ? m_DMLgameDir.c_str() : "%s:/games", partition)) != NULL && force_update[COVERFLOW_DML];
//gprintf("update_games=%d update_homebrew=%d update_dml=%d, update_emu=%d\n", update_games, update_homebrew, update_dml, update_emu); //gprintf("update_games=%d update_homebrew=%d update_dml=%d, update_emu=%d\n", update_games, update_homebrew, update_dml, update_emu);
@ -133,7 +133,7 @@ void CachedList::LoadChannels(string path, u32 channelType, string m_lastLanguag
if(m_update) if(m_update)
{ {
//gprintf("Updating channels\n"); gprintf("Updating channels\n");
list.GetChannels(*this, m_settingsDir, channelType, m_curLanguage); list.GetChannels(*this, m_settingsDir, channelType, m_curLanguage);
m_loaded = true; m_loaded = true;