Currently the pagination logic seems to not use the total number of pages available in the API but simply calling the endpoints for (e.g. episodes) until it gets a count of record less than the "per page" one (100).
This seems to have been working fine until a recent change in the API.
Now the 2nd page with no entries seems to return null instead of [] in data attribute.
Steps to reproduce:
TVDB.new(apikey: 'changeme').series(81189).episodes
# => NoMethodError undefined method `map' for nil:NilClass
This quick fix should address the issue without reworking the pagination logic.
Currently the pagination logic seems to not use the total number of pages available in the API but simply calling the endpoints for (e.g. episodes) until it gets a count of record less than the "per page" one (100).
This seems to have been working fine until a recent change in the API.
Now the 2nd page with no entries seems to return
null
instead of[]
indata
attribute.Steps to reproduce:
This quick fix should address the issue without reworking the pagination logic.