|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
@ -443,6 +443,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
|
|
|
|
private void DownloadImage(Series series, ImageFileResult image)
|
|
|
|
|
{
|
|
|
|
|
var fullPath = Path.Combine(series.Path, image.RelativePath);
|
|
|
|
|
var downloaded = true;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
@ -450,12 +451,19 @@ 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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
|
|
|
|
if (downloaded)
|
|
|
|
|
{
|
|
|
|
|
_mediaFileAttributeService.SetFilePermissions(fullPath);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (HttpException ex)
|
|
|
|
|
{
|
|
|
|
|