speechles 1920 Posted February 17, 2017 Share Posted February 17, 2017 (edited) 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 February 17, 2017 by speechles Link to comment Share on other sites More sharing options...
Luke 37133 Posted February 17, 2017 Share Posted February 17, 2017 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 More sharing options...
speechles 1920 Posted February 17, 2017 Author Share Posted February 17, 2017 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 More sharing options...
Luke 37133 Posted February 17, 2017 Share Posted February 17, 2017 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 More sharing options...
thatoneguy99 33 Posted October 7, 2017 Share Posted October 7, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now