rvs76 / tvdblib

Automatically exported from code.google.com/p/tvdblib
0 stars 0 forks source link

misformed uri when searching for episode by absolute order. #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
URI included season but when searching by absolute season is not used, search 
always returned episode 1.
I modified my TvdbLinkCreator.cs to the following to resolve.

Might be a cleaner way, but it works.

   internal static string CreateEpisodeLink(string _apiKey, int _seriesId, int _seasonNr,
                                             int _episodeNr, string _order, TvdbLanguage _lang)
    {
        String link;
        if (_order.Equals("absolute"))
        {
            link = String.Format("{0}/api/{1}/series/{2}/{3}/{5}/{6}.xml", BASE_SERVER, _apiKey,
                              _seriesId, _order, _seasonNr, _episodeNr, (_lang != null ? _lang.Abbriviation : "en"));
        }
        else
        {
            link = String.Format("{0}/api/{1}/series/{2}/{3}/{4}/{5}/{6}.xml", BASE_SERVER, _apiKey,
                                       _seriesId, _order, _seasonNr, _episodeNr, (_lang != null ? _lang.Abbriviation : "en"));
        }
      return link;
    }

Original issue reported on code.google.com by rashir...@gmail.com on 15 Feb 2011 at 4:12