mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Fixed: Don't try to create metadata images if source files doesn't exist
(cherry picked from commit 9a1022386a031c928fc0495d6ab990ebce605ec1) Closes #4132
This commit is contained in:
parent
3a74029035
commit
13b3555d25
1 changed files with 10 additions and 2 deletions
|
@ -470,6 +470,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||||
private void DownloadImage(Artist artist, ImageFileResult image)
|
private void DownloadImage(Artist artist, ImageFileResult image)
|
||||||
{
|
{
|
||||||
var fullPath = Path.Combine(artist.Path, image.RelativePath);
|
var fullPath = Path.Combine(artist.Path, image.RelativePath);
|
||||||
|
var downloaded = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -477,12 +478,19 @@ namespace NzbDrone.Core.Extras.Metadata
|
||||||
{
|
{
|
||||||
_httpClient.DownloadFile(image.Url, fullPath);
|
_httpClient.DownloadFile(image.Url, fullPath);
|
||||||
}
|
}
|
||||||
else
|
else if (_diskProvider.FileExists(image.Url))
|
||||||
{
|
{
|
||||||
_diskProvider.CopyFile(image.Url, fullPath);
|
_diskProvider.CopyFile(image.Url, fullPath);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
downloaded = false;
|
||||||
|
}
|
||||||
|
|
||||||
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
if (downloaded)
|
||||||
|
{
|
||||||
|
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (WebException ex)
|
catch (WebException ex)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue