tumblr / docs

Tumblr's public platform documentation.
Apache License 2.0
109 stars 27 forks source link

api.tumblr.com/v2/blog/{blog-identifier}/posts/{type}?tag= incorrect `total_posts` #59

Open derekmd opened 3 years ago

derekmd commented 3 years ago

Follow-up to https://github.com/tumblr/docs/issues/54

The bug was fixed last month to report the correct total_posts when filtering by tag:

https://api.tumblr.com/v2/blog/derekmd.tumblr.com/posts?tag=Villa+Amanzi

Filtering by post type also counts as expected:

https://api.tumblr.com/v2/blog/derekmd.tumblr.com/posts/photo

https://api.tumblr.com/v2/blog/derekmd.tumblr.com/posts/text


However if the post type filter is also included in the URL alongside tag filtering, the total_posts count is for the blog's unfiltered results:

https://api.tumblr.com/v2/blog/derekmd.tumblr.com/posts/photo?tag=Villa+Amanzi

https://api.tumblr.com/v2/blog/derekmd.tumblr.com/posts/text?tag=Villa+Amanzi

cyle commented 3 years ago

Thanks for writing in about this! Unfortunately this is expected behavior right now, as the filter-by-tag(s) option can be accurately counted at request time, but doing more than one kind of filtering (in this case, by tag and by type) cannot be accurately counted. I'll add a clarifying note about this in the docs, and we'll see if we can make this better on the backend.