support nfo episode attributes
This commit is contained in:
parent
38ba821c50
commit
2d3522593e
|
@ -188,6 +188,48 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||
break;
|
||||
}
|
||||
|
||||
case "displayseason":
|
||||
{
|
||||
var val = reader.ReadElementContentAsString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
int rval;
|
||||
|
||||
// int.TryParse is local aware, so it can be probamatic, force us culture
|
||||
if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval))
|
||||
{
|
||||
if ((item.ParentIndexNumber ?? 0) == 0)
|
||||
{
|
||||
item.AirsBeforeSeasonNumber = rval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case "displayepisode":
|
||||
{
|
||||
var val = reader.ReadElementContentAsString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(val))
|
||||
{
|
||||
int rval;
|
||||
|
||||
// int.TryParse is local aware, so it can be probamatic, force us culture
|
||||
if (int.TryParse(val, NumberStyles.Integer, UsCulture, out rval))
|
||||
{
|
||||
if ((item.ParentIndexNumber ?? 0) == 0)
|
||||
{
|
||||
item.AirsBeforeEpisodeNumber = rval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
base.FetchDataFromXmlNode(reader, itemResult);
|
||||
|
|
|
@ -72,11 +72,21 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
|||
{
|
||||
writer.WriteElementString("airsbefore_episode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
|
||||
}
|
||||
if (episode.AirsBeforeEpisodeNumber.HasValue)
|
||||
{
|
||||
writer.WriteElementString("displayepisode", episode.AirsBeforeEpisodeNumber.Value.ToString(UsCulture));
|
||||
}
|
||||
if (episode.AirsBeforeSeasonNumber.HasValue)
|
||||
{
|
||||
writer.WriteElementString("airsbefore_season", episode.AirsBeforeSeasonNumber.Value.ToString(UsCulture));
|
||||
}
|
||||
|
||||
var season = episode.AiredSeasonNumber;
|
||||
if (season.HasValue)
|
||||
{
|
||||
writer.WriteElementString("displayseason", season.Value.ToString(UsCulture));
|
||||
}
|
||||
|
||||
if (episode.DvdEpisodeNumber.HasValue)
|
||||
{
|
||||
writer.WriteElementString("DVD_episodenumber", episode.DvdEpisodeNumber.Value.ToString(UsCulture));
|
||||
|
|
Loading…
Reference in New Issue
Block a user