Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
derekmd opened this issue Sep 27, 2021 · 1 comment

Comments

@derekmd
Copy link

derekmd commented Sep 27, 2021

Follow-up to #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

  • response.total_posts = 1 ✔️
  • response.blog.posts = 2
  • response.blog.total_posts = 2

Filtering by post type also counts as expected:

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

  • response.total_posts = 2 ✔️
  • response.blog.posts = 2
  • response.blog.total_posts = 2

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

  • response.total_posts = 0 ✔️
  • response.blog.posts = 2
  • response.blog.total_posts = 2

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

  • response.total_posts = 2 ❌ (this should be 1 like above)
  • response.blog.posts = 2
  • response.blog.total_posts = 2

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

  • response.total_posts = 2 ❌ (this should be 0)
  • response.blog.posts = 2
  • response.blog.total_posts = 2
@cyle
Copy link
Member

cyle commented Sep 27, 2021

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.

sndsgd added a commit that referenced this issue Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants