mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
retry image saving to internal location
This commit is contained in:
@@ -203,10 +203,12 @@ namespace MediaBrowser.Server.Implementations.Configuration
|
||||
&& !string.Equals(Configuration.ItemsByNamePath ?? string.Empty, newPath))
|
||||
{
|
||||
// Validate
|
||||
if (!_fileSystem.DirectoryExists(newPath))
|
||||
if (!_fileSystem.DirectoryExists(newPath))
|
||||
{
|
||||
throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath));
|
||||
}
|
||||
|
||||
EnsureWriteAccess(newPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,13 +225,23 @@ namespace MediaBrowser.Server.Implementations.Configuration
|
||||
&& !string.Equals(Configuration.MetadataPath ?? string.Empty, newPath))
|
||||
{
|
||||
// Validate
|
||||
if (!_fileSystem.DirectoryExists(newPath))
|
||||
if (!_fileSystem.DirectoryExists(newPath))
|
||||
{
|
||||
throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath));
|
||||
}
|
||||
|
||||
EnsureWriteAccess(newPath);
|
||||
}
|
||||
}
|
||||
|
||||
private void EnsureWriteAccess(string path)
|
||||
{
|
||||
var file = Path.Combine(path, Guid.NewGuid().ToString());
|
||||
|
||||
_fileSystem.WriteAllText(file, string.Empty);
|
||||
_fileSystem.DeleteFile(file);
|
||||
}
|
||||
|
||||
public void DisableMetadataService(string service)
|
||||
{
|
||||
DisableMetadataService(typeof(Movie), Configuration, service);
|
||||
|
||||
Reference in New Issue
Block a user