diff --git a/source/loader/wbfs_ext.c b/source/loader/wbfs_ext.c index 6ab4d407..16cc2e20 100644 --- a/source/loader/wbfs_ext.c +++ b/source/loader/wbfs_ext.c @@ -158,20 +158,25 @@ s32 WBFS_Ext_RemoveGame(u8 *discid, char *gamepath) char folder[MAX_FAT_PATH]; STRCOPY(folder, gamepath); char *p = strrchr(folder, '/'); - if (p) *p = 0; + if(p) *p = 0; dir_iter = opendir(folder); if (!dir_iter) return 0; - while ((ent = readdir(dir_iter)) != NULL) + while((ent = readdir(dir_iter)) != NULL) { - if (ent->d_name[0] == '.') continue; + //if(ent->d_name[0] == '.') + // continue; + + if(strstr(ent->d_name, (char*)discid) != NULL) + { - snprintf(file, sizeof(file), "%s/%s", folder, ent->d_name); - //if(discid != NULL && strstr(file, (char*)discid) != NULL) + snprintf(file, sizeof(file), "%s/%s", folder, ent->d_name); + //if(discid != NULL && strstr(file, (char*)discid) != NULL) remove(file); + } } closedir(dir_iter); - //if(strlen(folder) > 11) + if(strlen(folder) > 11) unlink(folder); return 0; } diff --git a/source/menu/menu_wbfs.cpp b/source/menu/menu_wbfs.cpp index a3bbe889..c6d29a87 100644 --- a/source/menu/menu_wbfs.cpp +++ b/source/menu/menu_wbfs.cpp @@ -8,6 +8,7 @@ #include "music/SoundHandler.hpp" #include "channel/nand.hpp" #include "defines.h" +#include "wdvd.h" using namespace std; @@ -439,13 +440,21 @@ bool CMenu::_wbfsOp(CMenu::WBFS_OP op) m_btnMgr.setProgress(m_wbfsPBar, m_thrdProgress); m_btnMgr.setText(m_wbfsLblMessage, wfmt(_fmt("wbfsprogress", L"%i%%"), (int)(m_thrdProgress * 100.f))); if (!m_thrdWorking) + { + if(op == CMenu::WO_ADD_GAME) + { + WDVD_StopMotor(); + WDVD_Close(); + } m_btnMgr.show(m_wbfsBtnBack); + } } } _hideWBFS(); if (done && (op == CMenu::WO_REMOVE_GAME || op == CMenu::WO_ADD_GAME)) { - m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str()); + m_gameList.SetLanguage(m_loc.getString(m_curLanguage, "gametdb_code", "EN").c_str()); + if(upd_dml) UpdateCache(COVERFLOW_DML);