mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Fixed: Xbmc metadata no longer fails if an episode has no rating.
This commit is contained in:
parent
da26fa8322
commit
3907e2b168
@ -171,7 +171,12 @@ public override MetadataFileResult SeriesMetadata(Series series)
|
|||||||
var tvShow = new XElement("tvshow");
|
var tvShow = new XElement("tvshow");
|
||||||
|
|
||||||
tvShow.Add(new XElement("title", series.Title));
|
tvShow.Add(new XElement("title", series.Title));
|
||||||
tvShow.Add(new XElement("rating", series.Ratings.Value));
|
|
||||||
|
if (series.Ratings != null && series.Ratings.Votes > 0)
|
||||||
|
{
|
||||||
|
tvShow.Add(new XElement("rating", series.Ratings.Value));
|
||||||
|
}
|
||||||
|
|
||||||
tvShow.Add(new XElement("plot", series.Overview));
|
tvShow.Add(new XElement("plot", series.Overview));
|
||||||
tvShow.Add(new XElement("episodeguide", new XElement("url", episodeGuideUrl)));
|
tvShow.Add(new XElement("episodeguide", new XElement("url", episodeGuideUrl)));
|
||||||
tvShow.Add(new XElement("episodeguideurl", episodeGuideUrl));
|
tvShow.Add(new XElement("episodeguideurl", episodeGuideUrl));
|
||||||
@ -257,7 +262,11 @@ public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile ep
|
|||||||
}
|
}
|
||||||
|
|
||||||
details.Add(new XElement("watched", "false"));
|
details.Add(new XElement("watched", "false"));
|
||||||
details.Add(new XElement("rating", episode.Ratings.Value));
|
|
||||||
|
if (episode.Ratings != null && episode.Ratings.Votes > 0)
|
||||||
|
{
|
||||||
|
details.Add(new XElement("rating", episode.Ratings.Value));
|
||||||
|
}
|
||||||
|
|
||||||
//Todo: get guest stars, writer and director
|
//Todo: get guest stars, writer and director
|
||||||
//details.Add(new XElement("credits", tvdbEpisode.Writer.FirstOrDefault()));
|
//details.Add(new XElement("credits", tvdbEpisode.Writer.FirstOrDefault()));
|
||||||
|
@ -118,10 +118,7 @@ private static Episode MapEpisode(EpisodeResource oracleEpisode)
|
|||||||
episode.AirDate = oracleEpisode.AirDate;
|
episode.AirDate = oracleEpisode.AirDate;
|
||||||
episode.AirDateUtc = oracleEpisode.AirDateUtc;
|
episode.AirDateUtc = oracleEpisode.AirDateUtc;
|
||||||
|
|
||||||
if (oracleEpisode.Rating != null)
|
episode.Ratings = MapRatings(oracleEpisode.Rating);
|
||||||
{
|
|
||||||
episode.Ratings = MapRatings(oracleEpisode.Rating);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Don't include series fanart images as episode screenshot
|
//Don't include series fanart images as episode screenshot
|
||||||
if (oracleEpisode.Image != null)
|
if (oracleEpisode.Image != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user