Fixed: Refreshing season images for XBMC metadata when there are multiple types (poster, banner, etc)

This commit is contained in:
Mark McDowall 2014-04-02 07:26:18 -07:00
parent 9645fb07db
commit 380a813dbc
1 changed files with 10 additions and 6 deletions

View File

@ -313,14 +313,16 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
}
_diskProvider.CopyFile(source, destination, false);
var relativePath = DiskProviderBase.GetRelativePath(series.Path, destination);
var metadata = existingMetadataFiles.SingleOrDefault(c => c.Type == MetadataType.SeriesImage) ??
var metadata = existingMetadataFiles.SingleOrDefault(c => c.Type == MetadataType.SeriesImage &&
c.RelativePath == relativePath) ??
new MetadataFile
{
SeriesId = series.Id,
Consumer = GetType().Name,
Type = MetadataType.SeriesImage,
RelativePath = DiskProviderBase.GetRelativePath(series.Path, destination)
RelativePath = relativePath
};
yield return metadata;
@ -341,18 +343,20 @@ namespace NzbDrone.Core.Metadata.Consumers.Xbmc
}
var path = Path.Combine(series.Path, filename);
var relativePath = DiskProviderBase.GetRelativePath(series.Path, path);
DownloadImage(series, image.Url, path);
var metadata = existingMetadataFiles.SingleOrDefault(c => c.Type == MetadataType.SeasonImage &&
c.SeasonNumber == season.SeasonNumber) ??
c.SeasonNumber == season.SeasonNumber &&
c.RelativePath == relativePath) ??
new MetadataFile
{
SeriesId = series.Id,
SeasonNumber = season.SeasonNumber,
Consumer = GetType().Name,
Type = MetadataType.SeasonImage,
RelativePath = DiskProviderBase.GetRelativePath(series.Path, path)
RelativePath = relativePath
};
yield return metadata;