New: Use TVDB's Episode ID as default uniqueid for Kodi metadata
Closes #4792
This commit is contained in:
parent
9e82014454
commit
f6b08f697b
|
@ -0,0 +1,14 @@
|
|||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(167)]
|
||||
public class add_tvdbid_to_episode : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Episodes").AddColumn("TvdbId").AsInt32().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -271,10 +271,14 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
|||
details.Add(new XElement("displayepisode", episode.AiredBeforeEpisodeNumber ?? -1));
|
||||
}
|
||||
|
||||
var uniqueId = new XElement("uniqueid", episode.Id);
|
||||
uniqueId.SetAttributeValue("type", "sonarr");
|
||||
uniqueId.SetAttributeValue("default", true);
|
||||
details.Add(uniqueId);
|
||||
var tvdbId = new XElement("uniqueid", episode.TvdbId);
|
||||
tvdbId.SetAttributeValue("type", "tvdb");
|
||||
tvdbId.SetAttributeValue("default", true);
|
||||
details.Add(tvdbId);
|
||||
|
||||
var sonarrId = new XElement("uniqueid", episode.Id);
|
||||
sonarrId.SetAttributeValue("type", "sonarr");
|
||||
details.Add(sonarrId);
|
||||
|
||||
if (image == null)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook.Resource
|
|||
{
|
||||
public class EpisodeResource
|
||||
{
|
||||
public int TvdbId { get; set; }
|
||||
public int SeasonNumber { get; set; }
|
||||
public int EpisodeNumber { get; set; }
|
||||
public int? AbsoluteEpisodeNumber { get; set; }
|
||||
|
|
|
@ -223,6 +223,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
|||
private static Episode MapEpisode(EpisodeResource oracleEpisode)
|
||||
{
|
||||
var episode = new Episode();
|
||||
episode.TvdbId = oracleEpisode.TvdbId;
|
||||
episode.Overview = oracleEpisode.Overview;
|
||||
episode.SeasonNumber = oracleEpisode.SeasonNumber;
|
||||
episode.EpisodeNumber = oracleEpisode.EpisodeNumber;
|
||||
|
|
|
@ -17,6 +17,7 @@ namespace NzbDrone.Core.Tv
|
|||
public const string AIR_DATE_FORMAT = "yyyy-MM-dd";
|
||||
|
||||
public int SeriesId { get; set; }
|
||||
public int TvdbId { get; set; }
|
||||
public int EpisodeFileId { get; set; }
|
||||
public int SeasonNumber { get; set; }
|
||||
public int EpisodeNumber { get; set; }
|
||||
|
|
|
@ -64,6 +64,7 @@ namespace NzbDrone.Core.Tv
|
|||
}
|
||||
|
||||
episodeToUpdate.SeriesId = series.Id;
|
||||
episodeToUpdate.TvdbId = episode.TvdbId;
|
||||
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
|
||||
episodeToUpdate.SeasonNumber = episode.SeasonNumber;
|
||||
episodeToUpdate.AbsoluteEpisodeNumber = episode.AbsoluteEpisodeNumber;
|
||||
|
|
Loading…
Reference in New Issue