private static string GetEpisodeXml(SeriesBase series, Episode episode, IEnumerable <string> bannerImages) { var metadata = new EpisodeMetadata(); var m = new Movie { Title = episode.EpisodeName, Season = episode.SeasonNumber.Value, Episode = episode.EpisodeNumber.Value, Year = episode.FirstAired.Year, Rating = episode.Rating, Plot = series.Overview, EpisodePlot = episode.Overview, MPAA = series.ContentRating, Runtime = series.Runtime.Value, genres = SeriesIOHelper.ToArray(series.Genre), Director = episode.Director, Credits = episode.Writer }; var cast = series.Actors.Length > 0 ? series.Actors : episode.GuestStars; m.cast = SeriesIOHelper.ToArray(cast); m.image = bannerImages.ToArray(); metadata.Movie = m; return(metadata.AsXml()); }
public SeriesMetadata(SeriesBase series) { var s = new Series { Title = series.SeriesName, genres = SeriesIOHelper.ToArray(series.Genre), Premiered = series.FirstAired?.ToString(Constants.DATE_FMT), Year = series.FirstAired.HasValue ? series.FirstAired.Value.Year : DateTime.Today.Year, Rating = double.Parse(series.RatingString ?? "0") * 10, Status = series.Status, MPAA = series.MPAA, TvdbId = series.Id.ToString(), Runtime = series.Runtime.Value, Plot = series.Overview, cast = SeriesIOHelper.ToArray(series.Actors) }; Series = s; }