New: Added aired-before field to kodi metadata to sort specials
closes #3073
This commit is contained in:
parent
cde5a6d1a4
commit
c5257de436
|
@ -0,0 +1,16 @@
|
||||||
|
using FluentMigrator;
|
||||||
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Datastore.Migration
|
||||||
|
{
|
||||||
|
[Migration(137)]
|
||||||
|
public class add_airedbefore_to_episodes : NzbDroneMigrationBase
|
||||||
|
{
|
||||||
|
protected override void MainDbUpgrade()
|
||||||
|
{
|
||||||
|
Alter.Table("Episodes").AddColumn("AiredAfterSeasonNumber").AsInt32().Nullable()
|
||||||
|
.AddColumn("AiredBeforeSeasonNumber").AsInt32().Nullable()
|
||||||
|
.AddColumn("AiredBeforeEpisodeNumber").AsInt32().Nullable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -255,9 +255,15 @@ namespace NzbDrone.Core.Extras.Metadata.Consumers.Xbmc
|
||||||
details.Add(new XElement("aired", episode.AirDate));
|
details.Add(new XElement("aired", episode.AirDate));
|
||||||
details.Add(new XElement("plot", episode.Overview));
|
details.Add(new XElement("plot", episode.Overview));
|
||||||
|
|
||||||
//If trakt ever gets airs before information for specials we should add set it
|
if (episode.SeasonNumber == 0 && episode.AiredAfterSeasonNumber.HasValue)
|
||||||
details.Add(new XElement("displayseason"));
|
{
|
||||||
details.Add(new XElement("displayepisode"));
|
details.Add(new XElement("displayafterseason", episode.AiredAfterSeasonNumber));
|
||||||
|
}
|
||||||
|
else if (episode.SeasonNumber == 0 && episode.AiredBeforeSeasonNumber.HasValue)
|
||||||
|
{
|
||||||
|
details.Add(new XElement("displayseason", episode.AiredBeforeSeasonNumber));
|
||||||
|
details.Add(new XElement("displayepisode", episode.AiredBeforeEpisodeNumber ?? -1));
|
||||||
|
}
|
||||||
|
|
||||||
var uniqueId = new XElement("uniqueid", episode.Id);
|
var uniqueId = new XElement("uniqueid", episode.Id);
|
||||||
uniqueId.SetAttributeValue("type", "sonarr");
|
uniqueId.SetAttributeValue("type", "sonarr");
|
||||||
|
|
|
@ -7,6 +7,9 @@ namespace NzbDrone.Core.MetadataSource.SkyHook.Resource
|
||||||
public int SeasonNumber { get; set; }
|
public int SeasonNumber { get; set; }
|
||||||
public int EpisodeNumber { get; set; }
|
public int EpisodeNumber { get; set; }
|
||||||
public int? AbsoluteEpisodeNumber { get; set; }
|
public int? AbsoluteEpisodeNumber { get; set; }
|
||||||
|
public int? AiredAfterSeasonNumber { get; set; }
|
||||||
|
public int? AiredBeforeSeasonNumber { get; set; }
|
||||||
|
public int? AiredBeforeEpisodeNumber { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string AirDate { get; set; }
|
public string AirDate { get; set; }
|
||||||
public DateTime? AirDateUtc { get; set; }
|
public DateTime? AirDateUtc { get; set; }
|
||||||
|
|
|
@ -222,6 +222,9 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||||
episode.EpisodeNumber = oracleEpisode.EpisodeNumber;
|
episode.EpisodeNumber = oracleEpisode.EpisodeNumber;
|
||||||
episode.AbsoluteEpisodeNumber = oracleEpisode.AbsoluteEpisodeNumber;
|
episode.AbsoluteEpisodeNumber = oracleEpisode.AbsoluteEpisodeNumber;
|
||||||
episode.Title = oracleEpisode.Title;
|
episode.Title = oracleEpisode.Title;
|
||||||
|
episode.AiredAfterSeasonNumber = oracleEpisode.AiredAfterSeasonNumber;
|
||||||
|
episode.AiredBeforeSeasonNumber = oracleEpisode.AiredBeforeSeasonNumber;
|
||||||
|
episode.AiredBeforeEpisodeNumber = oracleEpisode.AiredBeforeEpisodeNumber;
|
||||||
|
|
||||||
episode.AirDate = oracleEpisode.AirDate;
|
episode.AirDate = oracleEpisode.AirDate;
|
||||||
episode.AirDateUtc = oracleEpisode.AirDateUtc;
|
episode.AirDateUtc = oracleEpisode.AirDateUtc;
|
||||||
|
|
|
@ -29,6 +29,9 @@ namespace NzbDrone.Core.Tv
|
||||||
public int? SceneAbsoluteEpisodeNumber { get; set; }
|
public int? SceneAbsoluteEpisodeNumber { get; set; }
|
||||||
public int? SceneSeasonNumber { get; set; }
|
public int? SceneSeasonNumber { get; set; }
|
||||||
public int? SceneEpisodeNumber { get; set; }
|
public int? SceneEpisodeNumber { get; set; }
|
||||||
|
public int? AiredAfterSeasonNumber { get; set; }
|
||||||
|
public int? AiredBeforeSeasonNumber { get; set; }
|
||||||
|
public int? AiredBeforeEpisodeNumber { get; set; }
|
||||||
public bool UnverifiedSceneNumbering { get; set; }
|
public bool UnverifiedSceneNumbering { get; set; }
|
||||||
public Ratings Ratings { get; set; }
|
public Ratings Ratings { get; set; }
|
||||||
public List<MediaCover.MediaCover> Images { get; set; }
|
public List<MediaCover.MediaCover> Images { get; set; }
|
||||||
|
|
|
@ -66,6 +66,9 @@ namespace NzbDrone.Core.Tv
|
||||||
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
|
episodeToUpdate.EpisodeNumber = episode.EpisodeNumber;
|
||||||
episodeToUpdate.SeasonNumber = episode.SeasonNumber;
|
episodeToUpdate.SeasonNumber = episode.SeasonNumber;
|
||||||
episodeToUpdate.AbsoluteEpisodeNumber = episode.AbsoluteEpisodeNumber;
|
episodeToUpdate.AbsoluteEpisodeNumber = episode.AbsoluteEpisodeNumber;
|
||||||
|
episodeToUpdate.AiredAfterSeasonNumber = episode.AiredAfterSeasonNumber;
|
||||||
|
episodeToUpdate.AiredBeforeSeasonNumber = episode.AiredBeforeSeasonNumber;
|
||||||
|
episodeToUpdate.AiredBeforeEpisodeNumber = episode.AiredBeforeEpisodeNumber;
|
||||||
episodeToUpdate.Title = episode.Title ?? "TBA";
|
episodeToUpdate.Title = episode.Title ?? "TBA";
|
||||||
episodeToUpdate.Overview = episode.Overview;
|
episodeToUpdate.Overview = episode.Overview;
|
||||||
episodeToUpdate.AirDate = episode.AirDate;
|
episodeToUpdate.AirDate = episode.AirDate;
|
||||||
|
|
Loading…
Reference in New Issue