fix fields that shouldn't be required

This commit is contained in:
Luke Pulverenti 2016-08-27 00:35:06 -04:00
parent ae331babed
commit 4fa0df37e2

View File

@ -64,25 +64,25 @@ namespace MediaBrowser.XbmcMetadata.Savers
writer.WriteElementString("aired", episode.PremiereDate.Value.ToLocalTime().ToString(formatString));
}
if (episode.AirsAfterSeasonNumber.HasValue)
if (episode.AirsAfterSeasonNumber.HasValue && episode.AirsAfterSeasonNumber.Value != -1)
{
writer.WriteElementString("airsafter_season", episode.AirsAfterSeasonNumber.Value.ToString(UsCulture));
}
if (episode.AirsBeforeEpisodeNumber.HasValue)
if (episode.AirsBeforeEpisodeNumber.HasValue && episode.AirsBeforeEpisodeNumber.Value != -1)
{
writer.WriteElementString("airsbefore_episode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
}
if (episode.AirsBeforeEpisodeNumber.HasValue)
if (episode.AirsBeforeEpisodeNumber.HasValue && episode.AirsBeforeEpisodeNumber.Value != -1)
{
writer.WriteElementString("displayepisode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
}
if (episode.AirsBeforeSeasonNumber.HasValue)
if (episode.AirsBeforeSeasonNumber.HasValue && episode.AirsBeforeSeasonNumber.Value != -1)
{
writer.WriteElementString("airsbefore_season", episode.AirsBeforeSeasonNumber.Value.ToString(UsCulture));
}
var season = episode.AiredSeasonNumber;
if (season.HasValue)
if (season.HasValue && season.Value != -1)
{
writer.WriteElementString("displayseason", season.Value.ToString(UsCulture));
}