Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="seriesID">The default series ID is Gravity Falls. This parameter doesn't seem to matter.</param>
        /// <returns></returns>
        public async Task <string[]> GetEpisodeSearchParameters(int seriesID = 259972)
        {
            LastError = "";
            if (!await CheckTokenAsync())
            {
                return(null);
            }

            SearchParamsResults result = await MakeRequestAsync <SearchParamsResults>("series/" + seriesID + "/episodes/query/params", null, Requestmethods.get);

            if (result.Error != null)
            {
                if (result.Error.Equals("Resource not found", StringComparison.CurrentCultureIgnoreCase))
                {
                    return(null);
                }
                LastError = result.Error;
                return(null);
            }

            return(result.Results);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the search params that can be used when looking up Series.
        /// *** THIS DOESN"T WORK ***
        /// It's in the API spec but calls will fail with not authorized.
        /// </summary>
        /// <returns>A list of keys that can be used when searching for a series</returns>
        public async Task <string[]> SearchSeriesParams()
        {
            LastError = "";
            if (!await CheckTokenAsync())
            {
                return(null);
            }

            SearchParamsResults result = await MakeRequestAsync <SearchParamsResults>("/search/series/params", null, Requestmethods.get);

            if (result.Error != null)
            {
                if (result.Error.Equals("Resource not found", StringComparison.CurrentCultureIgnoreCase))
                {
                    return(new string[0]);
                }

                LastError = result.Error;
                return(null);
            }

            return(result.Results);
        }