Skip to content

Commit 96885ce

Browse files
committed
cleanup RecordMovie.MakePath
this now allows creating tasproj files as originally intended but that will probably crash immediately because good coding
1 parent 1937420 commit 96885ce

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/BizHawk.Client.EmuHawk/movie/RecordMovie.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,14 @@ private string MakePath()
183183

184184
if (!string.IsNullOrWhiteSpace(path))
185185
{
186-
if (path.LastIndexOf(Path.DirectorySeparatorChar) == -1)
187-
{
188-
if (path[0] != Path.DirectorySeparatorChar)
189-
{
190-
path = path.Insert(0, Path.DirectorySeparatorChar.ToString());
191-
}
192-
193-
path = _config.PathEntries.MovieAbsolutePath() + path;
186+
path = Path.IsPathRooted(path)
187+
? Path.GetFullPath(path)
188+
: Path.Combine(_config.PathEntries.MovieAbsolutePath(), path);
194189

195-
if (!MovieService.MovieExtensions.Contains(Path.GetExtension(path)))
196-
{
197-
// If no valid movie extension, add movie extension
198-
path += $".{MovieService.StandardMovieExtension}";
199-
}
190+
if (!MovieService.MovieExtensions.Select(static ext => $".{ext}").Contains(Path.GetExtension(path)))
191+
{
192+
// If no valid movie extension, add movie extension
193+
path += $".{MovieService.StandardMovieExtension}";
200194
}
201195
}
202196

0 commit comments

Comments
 (0)