private IEnumerable <ITraktSyncWatchlistPostShowSeason> CreateSyncWatchlistPostShowSeasons(PostSeasons seasons) { var syncWatchlistPostShowSeasons = new List <ITraktSyncWatchlistPostShowSeason>(); foreach (PostSeason season in seasons) { var syncWatchlistPostShowSeason = new TraktSyncWatchlistPostShowSeason { Number = season.Number }; if (season.Episodes?.Count() > 0) { var syncWatchlistPostShowEpisodes = new List <ITraktSyncWatchlistPostShowEpisode>(); foreach (PostEpisode episode in season.Episodes) { syncWatchlistPostShowEpisodes.Add(new TraktSyncWatchlistPostShowEpisode { Number = episode.Number }); } syncWatchlistPostShowSeason.Episodes = syncWatchlistPostShowEpisodes; } syncWatchlistPostShowSeasons.Add(syncWatchlistPostShowSeason); } return(syncWatchlistPostShowSeasons); }
private ITraktSyncWatchlistPostShow CreateSyncWatchlistPostShowWithSeasonsCollection(ITraktShow show, PostSeasons seasons) { var syncWatchlistPostShow = CreateSyncWatchlistPostShow(show); if (seasons != null) { syncWatchlistPostShow.Seasons = CreateSyncWatchlistPostShowSeasons(seasons); } return(syncWatchlistPostShow); }
private IEnumerable <ITraktSyncCollectionPostShowSeason> CreateSyncCollectionPostShowSeasons(PostSeasons seasons) { var syncCollectionPostShowSeasons = new List <ITraktSyncCollectionPostShowSeason>(); foreach (PostSeason season in seasons) { var syncCollectionPostShowSeason = new TraktSyncCollectionPostShowSeason { Number = season.Number }; if (season.Episodes?.Count() > 0) { var syncCollectionPostShowEpisodes = new List <ITraktSyncCollectionPostShowEpisode>(); foreach (PostEpisode episode in season.Episodes) { syncCollectionPostShowEpisodes.Add(new TraktSyncCollectionPostShowEpisode { Number = episode.Number, MediaType = episode.Metadata?.MediaType, MediaResolution = episode.Metadata?.MediaResolution, Audio = episode.Metadata?.Audio, AudioChannels = episode.Metadata?.AudioChannels, ThreeDimensional = episode.Metadata?.ThreeDimensional, HDR = episode.Metadata?.HDR, CollectedAt = episode.At }); } syncCollectionPostShowSeason.Episodes = syncCollectionPostShowEpisodes; } syncCollectionPostShowSeasons.Add(syncCollectionPostShowSeason); } return(syncCollectionPostShowSeasons); }
private ITraktSyncCollectionPostShow CreateSyncCollectionPostShowWithSeasonsCollection(ITraktShow show, ITraktMetadata metadata = null, DateTime?collectedAt = null, PostSeasons seasons = null) { var syncCollectionPostShow = CreateSyncCollectionPostShow(show, metadata, collectedAt); if (seasons != null) { syncCollectionPostShow.Seasons = CreateSyncCollectionPostShowSeasons(seasons); } return(syncCollectionPostShow); }
private IEnumerable <ITraktUserCustomListItemsPostShowSeason> CreateUserCustomListItemsPostShowSeasons(PostSeasons seasons) { var userCustomListItemsPostShowSeasons = new List <ITraktUserCustomListItemsPostShowSeason>(); foreach (PostSeason season in seasons) { var userCustomListItemsPostShowSeason = new TraktUserCustomListItemsPostShowSeason { Number = season.Number }; if (season.Episodes?.Count() > 0) { var userCustomListItemsPostShowEpisodes = new List <ITraktUserCustomListItemsPostShowEpisode>(); foreach (PostEpisode episode in season.Episodes) { userCustomListItemsPostShowEpisodes.Add(new TraktUserCustomListItemsPostShowEpisode { Number = episode.Number }); } userCustomListItemsPostShowSeason.Episodes = userCustomListItemsPostShowEpisodes; } userCustomListItemsPostShowSeasons.Add(userCustomListItemsPostShowSeason); } return(userCustomListItemsPostShowSeasons); }
private ITraktUserCustomListItemsPostShow CreateUserCustomListItemsPostShowWithSeasonsCollection(ITraktShow show, PostSeasons seasons) { var userCustomListItemsPostShow = CreateUserCustomListItemsPostShow(show); if (seasons != null) { userCustomListItemsPostShow.Seasons = CreateUserCustomListItemsPostShowSeasons(seasons); } return(userCustomListItemsPostShow); }