Jump to content

moviecount/seriescount/recursiveitemcount


speechles

Recommended Posts

    else if i.Type = "Genre" or i.Type = "Studio"

        if (mode = "moviegenre" or mode = "moviestudio") and i.MovieCount <> invalid and type(i.MovieCount) = "Integer" then return Pluralize(i.MovieCount, "Movie")
        if (mode = "tvgenre" or mode = "tvstudio") and i.SeriesCount <> invalid and type(i.SeriesCount) = "Integer" then return Pluralize(i.SeriesCount, "Show")
        if i.RecursiveItemCount <> invalid then return Pluralize((i.RecursiveItemCount),"Item")

@@Luke

 

Above is the code I use to tell how many movies/series/items are contained within genres/studios. This was possible before without fetching all the items, to know the total count ahead of time.

 

Is moviecount/seriescount deprecated? I know recursiveitemcount requires you to fetch the items when you make the call, but moviecount and seriescount didnt require this. I dont want to fetch all the items to get the totals because all that is required from this view is the genre name and item count. I am also using enabletotalrecordcount=true and fields=itemcounts but this doesnt seem to work either.

 

Is there some way to know the total number of items in genres/studios without having to request all the items be sent in the payload?

Edited by speechles
Link to comment
Share on other sites

try adding the optional field ItemCounts. we had to drop these counts for performance reasons because the counting is done on the fly and for many people it's just too slow.

Link to comment
Share on other sites

Ive tried adding itemcounts but that requires having the items. I want to avoid getting items, since they are not used at that point. It populates the genre row the old way, using a single row with all genre names. This is the point I was using the counts to show extra info to users. Then as you click into each genre, at this point the relevant items are fetched using genre: genrename. So Ive just commented out the parts showing totals, rather than fetch all the items and using itemcounts. This is an acceptable trade-off for using the old view of genre/studio/network.

 

Thanks for the fast answer too. Wasnt the one I wanted to hear, but it is what it is. I can adapt. :)

 

Sent from my Nexus 7 using Tapatalk

Link to comment
Share on other sites

The DB has gotten faster so perhaps at some point we can reevaluate but with people wanting better performance on cheaper devices we've had to make some difficult decisions such as this.

Link to comment
Share on other sites

  • 7 months later...
thatoneguy99

How old is too old for necro posts? 

 Is it possible to pull this information with the current API? (Movie count and TV series count)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...