api-themoviedb icon indicating copy to clipboard operation
api-themoviedb copied to clipboard

parameter validation prevents ability to access TV series episodes in season 0.. the "specials"

Open warren-bank opened this issue 2 years ago • 0 comments

  1. where seasonNumber is passed in with value: 0
  2. where validation causes this value to be silently ignored
    • which causes the URL that makes the API request to be incorrectly formed.. and the service returns a 404

off-hand, a possible workaround could be:

  public void add(final Param key, final Integer value) {
    int minValue = (key == Param.SEASON_NUMBER) ? 0 : 1;

    if (value != null && value >= minValue) {
      parameters.put(key, String.valueOf(value));
    }
  }

warren-bank avatar Jun 02 '22 19:06 warren-bank