|
|
|
@ -470,6 +470,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
private void DownloadImage(Artist artist, ImageFileResult image)
|
|
|
|
|
{
|
|
|
|
|
var fullPath = Path.Combine(artist.Path, image.RelativePath);
|
|
|
|
|
var downloaded = true;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -477,13 +478,20 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
{
|
|
|
|
|
_httpClient.DownloadFile(image.Url, fullPath);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
else if (_diskProvider.FileExists(image.Url))
|
|
|
|
|
{
|
|
|
|
|
_diskProvider.CopyFile(image.Url, fullPath);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
downloaded = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (downloaded)
|
|
|
|
|
{
|
|
|
|
|
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (WebException ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, artist, ex.Message);
|
|
|
|
|