fix missing movie extension for game names that have a . at Length-4

This commit is contained in:
goyuken 2014-11-30 04:02:31 +00:00
parent 8271da0855
commit ff54192fdc
1 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using System.Linq;
using BizHawk.Common.ReflectionExtensions; using BizHawk.Common.ReflectionExtensions;
using BizHawk.Emulation.Common; using BizHawk.Emulation.Common;
@ -34,13 +35,14 @@ namespace BizHawk.Client.EmuHawk
path = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null) + path; path = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null) + path;
if (path[path.Length - 4] != '.') // If no file extension, add movie extension if (!MovieService.MovieExtensions.Contains(Path.GetExtension(path)))
{ {
path += "." + MovieService.DefaultExtension; // If no valid movie extension, add movie extension
path += "." + MovieService.DefaultExtension;
} }
} }
} }
return path; return path;
} }