mirror of
https://github.com/Readarr/Readarr
synced 2026-01-01 13:13:23 +01:00
Fixed: Don't try to create metadata images if source files doesn't exist
(cherry picked from commit 9a1022386a031c928fc0495d6ab990ebce605ec1) Closes #2933
This commit is contained in:
parent
fd5ab27df6
commit
b209d047fa
1 changed files with 10 additions and 2 deletions
|
|
@ -346,6 +346,7 @@ private List<MetadataFile> ProcessAuthorImages(IMetadata consumer, Author author
|
|||
private void DownloadImage(Author author, ImageFileResult image)
|
||||
{
|
||||
var fullPath = Path.Combine(author.Path, image.RelativePath);
|
||||
var downloaded = true;
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -353,12 +354,19 @@ private void DownloadImage(Author author, ImageFileResult image)
|
|||
{
|
||||
_httpClient.DownloadFile(image.Url, fullPath);
|
||||
}
|
||||
else
|
||||
else if (_diskProvider.FileExists(image.Url))
|
||||
{
|
||||
_diskProvider.CopyFile(image.Url, fullPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
downloaded = false;
|
||||
}
|
||||
|
||||
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
||||
if (downloaded)
|
||||
{
|
||||
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
||||
}
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue