mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-27 04:16:47 +00:00
retry image saving to internal location
This commit is contained in:
parent
6271ca99c8
commit
49d222a6d5
3 changed files with 53 additions and 19 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue