public TvShowEpisode GetEpisodeById(int episodeId)
        {
            ITvSeries bierdopje = channelFactory.CreateChannel();

            using (Stream responseStream = bierdopje.GetEpisodeById(episodeId.ToString()))
            {
                string responseString = CreateStringFromStream(responseStream);
                CloseChannel(bierdopje);
                return(responseParser.GetEpisode(responseString));
            }
        }
        public List <TvShowEpisodeSubtitle> GetAllSubsForEpisode(int episodeId, string language)
        {
            ITvSeries bierdopje = channelFactory.CreateChannel();

            using (Stream responseStream = bierdopje.GetAllSubsForEpisode(episodeId.ToString(), language))
            {
                string responseString = CreateStringFromStream(responseStream);
                CloseChannel(bierdopje);
                return(responseParser.GetSubtitles(responseString));
            }
        }
        public virtual List <TvShow> FindShowsByName(string name)
        {
            ITvSeries bierdopje = channelFactory.CreateChannel();

            using (Stream responseStream = bierdopje.FindShowByName(name))
            {
                string responseString = CreateStringFromStream(responseStream);
                CloseChannel(bierdopje);
                return(responseParser.GetTvShows(responseString));
            }
        }
        public virtual List <TvShowEpisode> GetAllEpisodesForShow(int showId)
        {
            ITvSeries bierdopje = channelFactory.CreateChannel();

            using (Stream responseStream = bierdopje.GetAllEpisodesForShow(showId.ToString()))
            {
                string responseString = CreateStringFromStream(responseStream);
                CloseChannel(bierdopje);
                return(responseParser.GetEpisodes(responseString));
            }
        }
        public List <TvShowEpisodeSubtitle> GetAllSubsFor(int showId, int season, int episodeId, string language, bool isTvBdId)
        {
            ITvSeries bierdopje = channelFactory.CreateChannel();

            using (Stream responseStream = bierdopje.GetAllSubsFor(showId.ToString(), season.ToString(), episodeId.ToString(), language, isTvBdId.ToString()))
            {
                string responseString = CreateStringFromStream(responseStream);
                CloseChannel(bierdopje);
                return(responseParser.GetSubtitles(responseString));
            }
        }
        public virtual bool TryGetShowByTvDbId(int tvDbId, out TvShowBase tvShow)
        {
            ITvSeries bierdopje = channelFactory.CreateChannel();

            using (Stream responseStream = bierdopje.GetShowByTvDbId(tvDbId.ToString()))
            {
                string responseString = CreateStringFromStream(responseStream);
                CloseChannel(bierdopje);
                tvShow = responseParser.GetTvShow(responseString);
                return(tvShow.id != 0);
            }
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            ITvSeries unfilmed = TvSeries.Null;

            unfilmed.Play(); //no exception

            ITvSeries dw = new DoctorWho();

            dw.Play();

            Console.ReadKey();
        }
 private static void CloseChannel(ITvSeries bierdopje)
 {
     ((IChannel)bierdopje).Close();
 }
 private static void CloseChannel(ITvSeries bierdopje)
 {
     ((IChannel) bierdopje).Close();
 }