mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-26 10:44:50 +03:00
Added error handling for both IBN and providers
This commit is contained in:
parent
42a2835633
commit
97bc7ec378
@@ -121,6 +121,22 @@ namespace MediaBrowser.Controller.IO
|
||||
|
||||
[DllImport("kernel32")]
|
||||
private static extern bool FindClose(IntPtr hFindFile);
|
||||
|
||||
private const char SpaceChar = ' ';
|
||||
private static char[] InvalidFileNameChars = Path.GetInvalidFileNameChars();
|
||||
|
||||
/// <summary>
|
||||
/// Takes a filename and removes invalid characters
|
||||
/// </summary>
|
||||
public static string GetValidFilename(string filename)
|
||||
{
|
||||
foreach (char c in InvalidFileNameChars)
|
||||
{
|
||||
filename = filename.Replace(c, SpaceChar);
|
||||
}
|
||||
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
|
||||
Reference in New Issue
Block a user