fix movie backup saving path (was affected by PWD)

This commit is contained in:
zeromus 2018-01-21 14:17:14 -06:00
parent 70d09673bc
commit b3b41fb75f
2 changed files with 4 additions and 1 deletions

View File

@ -155,6 +155,8 @@ namespace BizHawk.Client.Common
public string MoviesPathFragment => Global.Config.PathEntries["Global", "Movies"].Path;
public string MoviesBackupsPathFragment => Global.Config.PathEntries["Global", "Movie backups"].Path;
public string LuaPathFragment => Global.Config.PathEntries["Global", "Lua"].Path;
public string FirmwaresPathFragment => Global.Config.PathEntries["Global", "Firmware"].Path;

View File

@ -20,9 +20,10 @@ namespace BizHawk.Client.Common
return;
}
var backupDir = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesBackupsPathFragment, null);
var backupName = Filename;
backupName = backupName.Insert(Filename.LastIndexOf("."), $".{DateTime.Now:yyyy-MM-dd HH.mm.ss}");
backupName = Path.Combine(Global.Config.PathEntries["Global", "Movie backups"].Path, Path.GetFileName(backupName));
backupName = Path.Combine(backupDir, Path.GetFileName(backupName));
var directoryInfo = new FileInfo(backupName).Directory;
if (directoryInfo != null)