Updated based on review feedback

This commit is contained in:
crobibero
2020-11-13 18:04:06 -07:00
parent 24ac5cc353
commit 73d2cb1c2a
13 changed files with 25 additions and 22 deletions

View File

@@ -128,7 +128,7 @@ namespace MediaBrowser.LocalMetadata.Savers
private void SaveToFile(Stream stream, string path)
{
var directory = Path.GetDirectoryName(path) ?? throw new ResourceNotFoundException(nameof(path));
var directory = Path.GetDirectoryName(path) ?? throw new ArgumentException($"Provided path ({path}) is not valid.", nameof(path));
Directory.CreateDirectory(directory);
// On Windows, savint the file will fail if the file is hidden or readonly
FileSystem.SetAttributes(path, false, false);