diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index 4b2bab5..30f925b 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -175,15 +175,26 @@ Public Class frmGameManager Return sPath End Function - Private Sub CheckManifestandUpdate(ByVal oOriginalApp As clsGame, ByVal oNewApp As clsGame) + Private Sub CheckManifestandUpdate(ByVal oOriginalApp As clsGame, ByVal oNewApp As clsGame, ByVal bUseGameID As Boolean) Dim oBackupItems As List(Of clsBackup) Dim sDirectory As String Dim sNewDirectory As String Dim sFileName As String Dim sNewFileName As String + Dim sNewAppItem As String + Dim sOriginalAppItem As String + + 'If there is a valid change, check and update the manifest + If (oNewApp.ID <> oOriginalApp.ID) Or (oNewApp.FileSafeName <> oOriginalApp.FileSafeName) Then + 'Choose how to perform file & folder renames + If bUseGameID Then + sNewAppItem = oNewApp.ID + sOriginalAppItem = oOriginalApp.ID + Else + sNewAppItem = oNewApp.FileSafeName + sOriginalAppItem = oOriginalApp.FileSafeName + End If - 'If there is an ID change, check and update the manifest - If oNewApp.ID <> oOriginalApp.ID Then 'Local If mgrManifest.DoManifestCheck(oOriginalApp.ID, mgrSQLite.Database.Local) Then oBackupItems = mgrManifest.DoManifestGetByMonitorID(oOriginalApp.ID, mgrSQLite.Database.Local) @@ -193,14 +204,14 @@ Public Class frmGameManager sFileName = BackupFolder & oBackupItem.FileName 'Rename Backup File - sNewFileName = Path.GetDirectoryName(sFileName) & Path.DirectorySeparatorChar & Path.GetFileName(sFileName).Replace(oOriginalApp.ID, oNewApp.ID) + sNewFileName = Path.GetDirectoryName(sFileName) & Path.DirectorySeparatorChar & Path.GetFileName(sFileName).Replace(sOriginalAppItem, sNewAppItem) If File.Exists(sFileName) And Not sFileName = sNewFileName Then FileSystem.Rename(sFileName, sNewFileName) End If 'Rename Directory sDirectory = Path.GetDirectoryName(sFileName) - sNewDirectory = sDirectory.Replace(oOriginalApp.ID, oNewApp.ID) + sNewDirectory = sDirectory.Replace(sOriginalAppItem, sNewAppItem) If sDirectory <> sNewDirectory Then If Directory.Exists(sDirectory) And Not sDirectory = sNewDirectory Then FileSystem.Rename(sDirectory, sNewDirectory) @@ -208,7 +219,7 @@ Public Class frmGameManager End If oBackupItem.MonitorID = oNewApp.ID - oBackupItem.FileName = oBackupItem.FileName.Replace(oOriginalApp.ID, oNewApp.ID) + oBackupItem.FileName = oBackupItem.FileName.Replace(sOriginalAppItem, sNewAppItem) mgrManifest.DoManifestUpdateByManifestID(oBackupItem, mgrSQLite.Database.Local) Next End If @@ -219,7 +230,7 @@ Public Class frmGameManager For Each oBackupItem As clsBackup In oBackupItems oBackupItem.MonitorID = oNewApp.ID - oBackupItem.FileName = oBackupItem.FileName.Replace(oOriginalApp.ID, oNewApp.ID) + oBackupItem.FileName = oBackupItem.FileName.Replace(sOriginalAppItem, sNewAppItem) mgrManifest.DoManifestUpdateByManifestID(oBackupItem, mgrSQLite.Database.Remote) Next End If @@ -1285,7 +1296,7 @@ Public Class frmGameManager Case eModes.Edit If CoreValidatation(oApp, False) Then bSuccess = True - CheckManifestandUpdate(oCurrentGame, oApp) + CheckManifestandUpdate(oCurrentGame, oApp, oSettings.UseGameID) mgrMonitorList.DoListUpdate(oApp, CurrentGame.ID) eCurrentMode = eModes.View End If diff --git a/GBM/readme.txt b/GBM/readme.txt index 4504f4d..66d9717 100644 --- a/GBM/readme.txt +++ b/GBM/readme.txt @@ -17,6 +17,7 @@ All Platforms: - 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. +- Fixed an issue that caused GBM not to rename backup files or sub-folders unless the "Use Game ID for files and folders" setting was enabled. - GBM no longer displays a sync warning when the user deletes all game configurations from the Game Manager. The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html \ No newline at end of file