Example #1
0
        public ICollection <XbmcTvEpisode> GetTvEpisodes(XbmcTvShow tvshow, int season, int start, int end, params string[] fields)
        {
            if (tvshow == null)
            {
                throw new ArgumentNullException("tvshow");
            }

            return(this.getTvEpisodes(tvshow.Id, season, start, end, fields));
        }
Example #2
0
        public ICollection <XbmcTvSeason> GetTvSeasons(XbmcTvShow tvshow, params string[] fields)
        {
            if (tvshow == null)
            {
                throw new ArgumentNullException("tvshow");
            }

            return(this.getTvSeasons(tvshow.Id, -1, -1, fields));
        }
Example #3
0
        public ICollection <XbmcTvShow> GetTvShows(int start, int end, params string[] fields)
        {
            this.client.LogMessage("XbmcVideoLibrary.GetTvShows()");

            JObject args = new JObject();

            if (fields != null && fields.Length > 0)
            {
                string[] fieldCopy = new string[fields.Length + 2];
                fieldCopy[0] = "tvshowid";
                fieldCopy[1] = "title";
                Array.Copy(fields, 0, fieldCopy, 2, fields.Length);
                args.Add(new JProperty("fields", fieldCopy));
            }
            else
            {
                args.Add(new JProperty("fields", XbmcTvShow.Fields));
            }
            JObject limits = new JObject();

            if (start >= 0)
            {
                limits.Add(new JProperty("start", start));
            }
            if (end >= 0)
            {
                limits.Add(new JProperty("end", end));
            }
            args.Add(new JProperty("limits", limits));


            JObject query = this.client.Call("VideoLibrary.GetTVShows", args) as JObject;

            if (query == null || query["tvshows"] == null)
            {
                this.client.LogErrorMessage("VideoLibrary.GetTVShows(): Invalid response");

                return(null);
            }

            List <XbmcTvShow> shows = new List <XbmcTvShow>();

            foreach (JObject item in (JArray)query["tvshows"])
            {
                shows.Add(XbmcTvShow.FromJson(item, this.client));
            }

            return(shows);
        }
        public ICollection<XbmcTvSeason> GetTvSeasons(XbmcTvShow tvshow, int start, int end, params string[] fields)
        {
            if (tvshow == null)
            {
                throw new ArgumentNullException("tvshow");
            }

            return this.getTvSeasons(tvshow.Id, start, end, fields);
        }
        public ICollection<XbmcTvEpisode> GetTvEpisodes(XbmcTvShow tvshow, int season, params string[] fields)
        {
            if (tvshow == null)
            {
                throw new ArgumentNullException("tvshow");
            }

            return this.getTvEpisodes(tvshow.Id, season, -1, -1, fields);
        }