diff --git a/GBM/Managers/mgrCommon.vb b/GBM/Managers/mgrCommon.vb index 6aacf4d..ccdeb1a 100644 --- a/GBM/Managers/mgrCommon.vb +++ b/GBM/Managers/mgrCommon.vb @@ -434,15 +434,22 @@ Public Class mgrCommon Dim oDir As DirectoryInfo Dim sDir As String = sBackupFolder & oBackup.MonitorID - 'Delete sub directory if it's empty + 'Check if the sub-folder is an ID or Name If oBackup.FileName.StartsWith(oBackup.MonitorID & Path.DirectorySeparatorChar) Then - If Directory.Exists(sDir) Then - 'Check if there's any sub-directories or files remaining - oDir = New DirectoryInfo(sDir) - If oDir.GetDirectories.Length = 0 And oDir.GetFiles.Length = 0 Then - 'Folder is empty, delete the empty sub-folder - If Directory.Exists(sDir) Then DeleteDirectory(sDir) - End If + sDir = sBackupFolder & oBackup.MonitorID + ElseIf oBackup.FileName.StartsWith(oBackup.Name & Path.DirectorySeparatorChar) Then + sDir = sBackupFolder & oBackup.Name + Else + Exit Sub + End If + + 'Delete sub directory if it's empty + If Directory.Exists(sDir) Then + 'Check if there's any sub-directories or files remaining + oDir = New DirectoryInfo(sDir) + If oDir.GetDirectories.Length = 0 And oDir.GetFiles.Length = 0 Then + 'Folder is empty, delete the empty sub-folder + If Directory.Exists(sDir) Then DeleteDirectory(sDir) End If End If End Sub diff --git a/GBM/readme.txt b/GBM/readme.txt index c74b962..9acba03 100644 --- a/GBM/readme.txt +++ b/GBM/readme.txt @@ -14,7 +14,8 @@ All Platforms: - "Save Multiple Backups" and "Backup Limit" are now core fields, they are synced by default and included in the Import/Export. - The Game Manager will now clean up it's own manifest when backup files are deleted outside of GBM. As to not affect performance, this only occurs when the "Backup Data" field is accessed. - When a single game is selected, the Game Manager now restores the currently selected backup, instead of always restoring the latest backup. -- Fixed an issue that could cause the certain controls to become enabled incorrectly on the Game Manager. - GBM now displays the full path of the detected process when multiple configurations are triggered. +- Fixed an issue that could cause the certain controls to become enabled incorrectly on the Game Manager. +- Fixed an issue that caused GBM not to remove empty sub-folders unless the "Use Game ID for files and folders" setting was enabled when the folder was created. The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html \ No newline at end of file