mirror of
https://github.com/Radarr/Radarr.git
synced 2025-04-24 06:27:08 -04:00
Fixed: Don't try to create metadata images if source files doesn't exist
(cherry picked from commit 9a1022386a031c928fc0495d6ab990ebce605ec1) Closes #9189
This commit is contained in:
parent
97c2d4f9db
commit
24a17a9240
1 changed files with 10 additions and 2 deletions
|
@ -297,6 +297,7 @@ namespace NzbDrone.Core.Extras.Metadata
|
|||
private void DownloadImage(Movie movie, ImageFileResult image)
|
||||
{
|
||||
var fullPath = Path.Combine(movie.Path, image.RelativePath);
|
||||
var downloaded = true;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -304,12 +305,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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue