mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-25 19:31:58 +01:00
-fixed double gamecube games created
This commit is contained in:
parent
1b33874ca5
commit
bd40c72b13
@ -17,7 +17,6 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage,
|
||||
|
||||
bool ditimes = false;
|
||||
bool music = typeid(T) == typeid(std::string);
|
||||
bool emu = strcasestr(path.c_str(), m_plugin.getString("PLUGIN","romDir","").c_str()) != NULL;
|
||||
if(music)
|
||||
gprintf("Loading music list from path: %s\n",path.c_str());
|
||||
else if(!m_wbfsFS)
|
||||
@ -26,7 +25,7 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage,
|
||||
|
||||
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_emu = emu && force_update[COVERFLOW_EMU];
|
||||
update_emu = strcasestr(path.c_str(), m_plugin.getString("PLUGIN","romDir","").c_str()) != NULL && force_update[COVERFLOW_EMU];
|
||||
|
||||
const char* partition = DeviceName[DeviceHandler::Instance()->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];
|
||||
@ -47,7 +46,7 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage,
|
||||
ditimes = discinfo.st_mtime > cache.st_mtime;
|
||||
|
||||
m_update = update_lang || noDB || mtimes || ditimes;
|
||||
if(m_update) gprintf("Cache of %s is being updated because:", path.c_str());
|
||||
if(m_update) gprintf("Cache of %s is being updated because:\n", path.c_str());
|
||||
if(update_lang) gprintf("Languages are different!\nOld language string: %s\nNew language string: %s\n", m_lastLanguage.c_str(), m_curLanguage.c_str());
|
||||
if(noDB) gprintf("A database was not found!\n");
|
||||
if(mtimes || ditimes) gprintf("The WBFS folder was modified!\nCache date: %i\nFolder date: %i\n", cache.st_mtime, filestat.st_mtime);
|
||||
@ -80,7 +79,7 @@ void CachedList<T>::Load(string path, string containing, string m_lastLanguage,
|
||||
gprintf("Calling list to update filelist\n");
|
||||
|
||||
vector<string> pathlist;
|
||||
list.GetPaths(pathlist, containing, path, m_wbfsFS, (update_dml || (m_update && strcasestr(path.c_str(), ":/games") != NULL)), (music || emu));
|
||||
list.GetPaths(pathlist, containing, path, m_wbfsFS, (update_dml || (m_update && strcasestr(path.c_str(), ":/games") != NULL)), (!update_emu && !music));
|
||||
list.GetHeaders(pathlist, *this, m_settingsDir, m_curLanguage, m_DMLgameDir, m_plugin);
|
||||
|
||||
path.append("/touch.db");
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "fileOps.h"
|
||||
|
||||
template <typename T>
|
||||
void CList<T>::GetPaths(vector<string> &pathlist, string containing, string directory, bool wbfs_fs, bool dml, bool no_depth_limit)
|
||||
void CList<T>::GetPaths(vector<string> &pathlist, string containing, string directory, bool wbfs_fs, bool dml, bool depth_limit)
|
||||
{
|
||||
if (!wbfs_fs)
|
||||
{
|
||||
@ -30,6 +30,7 @@ void CList<T>::GetPaths(vector<string> &pathlist, string containing, string dire
|
||||
if(ent->d_type == DT_REG)
|
||||
{
|
||||
for(vector<string>::iterator compare = compares.begin(); compare != compares.end(); compare++)
|
||||
{
|
||||
if (strcasestr(ent->d_name, (*compare).c_str()) != NULL)
|
||||
{
|
||||
//gprintf("Pushing %s to the list.\n", sfmt("%s/%s", directory.c_str(), ent->d_name).c_str());
|
||||
@ -37,6 +38,7 @@ void CList<T>::GetPaths(vector<string> &pathlist, string containing, string dire
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
temp_pathlist.push_back(sfmt("%s/%s", directory.c_str(), ent->d_name));
|
||||
}
|
||||
@ -45,18 +47,8 @@ void CList<T>::GetPaths(vector<string> &pathlist, string containing, string dire
|
||||
bool FoundFile;
|
||||
while(temp_pathlist.size())
|
||||
{
|
||||
if(temp_pathlist[0].size() == 0)
|
||||
{
|
||||
while((dir_itr = opendir(temp_pathlist[0].c_str())) && !dir_itr)
|
||||
temp_pathlist.erase(temp_pathlist.begin());
|
||||
continue;
|
||||
}
|
||||
|
||||
dir_itr = opendir(temp_pathlist[0].c_str());
|
||||
if(!dir_itr)
|
||||
{
|
||||
temp_pathlist.erase(temp_pathlist.begin());
|
||||
continue;
|
||||
}
|
||||
|
||||
FoundFile = false;
|
||||
|
||||
@ -65,6 +57,8 @@ void CList<T>::GetPaths(vector<string> &pathlist, string containing, string dire
|
||||
{
|
||||
if(ent->d_name[0] == '.')
|
||||
continue;
|
||||
if(dml && FoundFile)
|
||||
break;
|
||||
if(ent->d_type == DT_REG)
|
||||
{
|
||||
for(vector<string>::iterator compare = compares.begin(); compare != compares.end(); compare++)
|
||||
@ -80,7 +74,7 @@ void CList<T>::GetPaths(vector<string> &pathlist, string containing, string dire
|
||||
}
|
||||
else
|
||||
{
|
||||
if(no_depth_limit)
|
||||
if(!depth_limit)
|
||||
temp_pathlist.push_back(sfmt("%s/%s", temp_pathlist[0].c_str(), ent->d_name));
|
||||
else if(dml && !FoundFile && strncasecmp(ent->d_name, "sys", 3) == 0 &&
|
||||
fsop_FileExist(fmt("%s/%s/boot.bin", temp_pathlist[0].c_str(), ent->d_name)))
|
||||
@ -88,7 +82,6 @@ void CList<T>::GetPaths(vector<string> &pathlist, string containing, string dire
|
||||
FoundFile = true;
|
||||
//gprintf("Pushing %s to the list.\n", sfmt("%s/%s/boot.bin", temp_pathlist[0].c_str(), ent->d_name).c_str());
|
||||
pathlist.push_back(sfmt("%s/%s/boot.bin", temp_pathlist[0].c_str(), ent->d_name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class CList
|
||||
public:
|
||||
CList(){};
|
||||
~CList(){};
|
||||
void GetPaths(vector<string> &pathlist, string containing, string directory, bool wbfs_fs = false, bool dml = false, bool no_depth_limit = false);
|
||||
void GetPaths(vector<string> &pathlist, string containing, string directory, bool wbfs_fs = false, bool dml = false, bool depth_limit = true);
|
||||
void GetHeaders(vector<string> pathlist, vector<T> &headerlist, string, string, string, Config &plugin);
|
||||
void GetChannels(vector<T> &headerlist, string, u32, string);
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user