Jump to content

Weird responce with ParentId vs no ParentId


TeamB
 Share

Recommended Posts

TeamB

@Luke

I have a situation where I have 2 queries, one with ParentId and one without ParentId, apart from that they are exactly the same query.

The one without ParentId is only returning 3 Items, the one with ParentId returns the full limit count of 20 items.

With ParentId, this one return 20 items as expected

http://<IP_ADDRESS>:8096/emby/Users/<USER_ID>/Items/Latest
?IncludeItemTypes=Episode
&IsMissing=False
&ImageTypeLimit=1
&Limit=20
&Recursive=True
&format=json
&Fields=DateCreated,EpisodeCount,SeasonCount,Path,Genres,Studios,Etag,Taglines,SortName,RecursiveItemCount,ChildCount,ProductionLocations,CriticRating,OfficialRating,CommunityRating,PremiereDate,ProductionYear,AirTime,Status,Tags,MediaStreams,Overview
&SortOrder=Descending
&ParentId=<VIEW ID OF TV SHOWS LIB>
&SortBy=DateCreated
&api_key=<API_KEY>

Without ParentId, this one only return 3 items

http://<IP_ADDRESS>:8096/emby/Users/<USER_ID>/Items/Latest
?IncludeItemTypes=Episode
&IsMissing=False
&ImageTypeLimit=1
&Limit=20
&Recursive=True
&format=json
&Fields=DateCreated,EpisodeCount,SeasonCount,Path,Genres,Studios,Etag,Taglines,SortName,RecursiveItemCount,ChildCount,ProductionLocations,CriticRating,OfficialRating,CommunityRating,PremiereDate,ProductionYear,AirTime,Status,Tags,MediaStreams,Overview
&SortOrder=Descending
&SortBy=DateCreated
&api_key=<API_KEY>

As you can see the only difference is the ParentId

I am not sure what is going on here, this used to work at some point otherwise I would not have have added it, I have not recently hanged anything, this has been in EmbyCon for over a year.

Any ideas?

What I expect is the one without the parent id to still show all the 20 items as I am asking for global and not restricting it to just a parent. It should show the same list as the one with the parent as I only have one TV Show lib.

 

 

Edited by TeamB
Link to comment
Share on other sites

Curious - what three items are returned?

That call would never be used without a parent ID in our apps so that's probably why this fell through the cracks if it did.

Link to comment
Share on other sites

Actually I think it's because the results are grouped and the grouping is happening after the limit being applied.

Link to comment
Share on other sites

3 minutes ago, Luke said:

Actually I think it's because the results are grouped and the grouping is happening after the limit being applied.

That's what I suspected possibly as well and why I asked what the items were.  Expected them to be TV Series possibly.

Link to comment
Share on other sites

TeamB

Yeah I think it is grouping and limiting before the grouping takes place.

You can see I have a lot of new episodes in the first 3 items of the latest TV Shows

image.thumb.png.64a1b29b0ead077dffdcecabdb368964.png

 

However when I use the API WITH a Parent ID I get the full list

image.thumb.png.7cc3f77755fc765bb74abdbf9ee767a0.png

So it does work but only with a parent ID??

 

Link to comment
Share on other sites

It needs to be improved to group before the limit, not after.  It works better with a parent id because the grouping mechanism is a little different per content type, and the parent id allows a more specific method to be used as opposed to a generic one.

Link to comment
Share on other sites

TeamB
9 hours ago, Luke said:

It needs to be improved to group before the limit, not after.  It works better with a parent id because the grouping mechanism is a little different per content type, and the parent id allows a more specific method to be used as opposed to a generic one.

Do you think this is likely to improve or should I implement a workaround?

 

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
 Share

×
×
  • Create New...