finally fucking fixed RenameFileWithInvalidChars
This commit is contained in:
parent
cc6b807c3d
commit
f1324f3de9
|
|
@ -1900,6 +1900,8 @@ public class GlobalFuncs
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RenameFileWithInvalidChars(string path)
|
public static void RenameFileWithInvalidChars(string path)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (!FileHasInvalidChars(path))
|
if (!FileHasInvalidChars(path))
|
||||||
return;
|
return;
|
||||||
|
|
@ -1909,7 +1911,14 @@ public class GlobalFuncs
|
||||||
fileName = Regex.Replace(fileName, @"[^\w-.'_!()& ]", "");
|
fileName = Regex.Replace(fileName, @"[^\w-.'_!()& ]", "");
|
||||||
string finalPath = pathWithoutFilename + "\\" + fileName;
|
string finalPath = pathWithoutFilename + "\\" + fileName;
|
||||||
|
|
||||||
FixedFileMove(path, finalPath, false);
|
FixedFileMove(path, finalPath, File.Exists(finalPath));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
#if LAUNCHER || CMD || URI
|
||||||
|
LogExceptions(ex);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LAUNCHER || CMD || URI
|
#if LAUNCHER || CMD || URI
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue