From ba226004123785b7f79c696d9f2afb27e7343bc0 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 16 Feb 2014 22:41:13 -0800 Subject: [PATCH] Couple XBMC Metadata fixes Fixed: Actor URL for XBMC Metadata Fixed: Incorrectly storing season images for XBMC metadata (cherry picked from commit 5b2c3b88c0fdf002bb46a45e85c2f5066cc84877) --- .../041_fix_xbmc_season_images_metadata.cs | 14 ++++++++++++++ .../MetaData/Consumers/Xbmc/XbmcMetadata.cs | 4 ++-- src/NzbDrone.Core/NzbDrone.Core.csproj | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/041_fix_xbmc_season_images_metadata.cs diff --git a/src/NzbDrone.Core/Datastore/Migration/041_fix_xbmc_season_images_metadata.cs b/src/NzbDrone.Core/Datastore/Migration/041_fix_xbmc_season_images_metadata.cs new file mode 100644 index 000000000..25cbc8ed4 --- /dev/null +++ b/src/NzbDrone.Core/Datastore/Migration/041_fix_xbmc_season_images_metadata.cs @@ -0,0 +1,14 @@ +using FluentMigrator; +using NzbDrone.Core.Datastore.Migration.Framework; + +namespace NzbDrone.Core.Datastore.Migration +{ + [Migration(41)] + public class fix_xbmc_season_images_metadata : NzbDroneMigrationBase + { + protected override void MainDbUpgrade() + { + Execute.Sql("UPDATE MetadataFiles SET Type = 4 WHERE Consumer = 'XbmcMetadata' AND SeasonNumber IS NOT NULL"); + } + } +} diff --git a/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs index a4d5ac080..e9f58aa39 100644 --- a/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs @@ -217,7 +217,7 @@ private void WriteTvShowNfo(Series series, List existingMetadataFi tvShow.Add(new XElement("actor", new XElement("name", actor.Name), new XElement("role", actor.Character), - new XElement("thumb", actor.Images.First()) + new XElement("thumb", actor.Images.First().Url) )); } @@ -296,7 +296,7 @@ private void WriteSeasonImages(Series series, List existingMetadat SeriesId = series.Id, SeasonNumber = season.SeasonNumber, Consumer = GetType().Name, - Type = MetadataType.SeriesMetadata, + Type = MetadataType.SeasonImage, RelativePath = DiskProviderBase.GetRelativePath(series.Path, path) }; diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 92c3429c2..89cb0b967 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -197,6 +197,7 @@ +