Controlling the number of items returned from the contentDirectory

66 views
Skip to first unread message

Nick Sturrock

unread,
Oct 9, 2012, 4:33:43 PM10/9/12
to up...@googlegroups.com
I'm using the BrowseWithObjectID function to retrieve items from the content directory as per the examples but it only seems to return me a small number of items (in the case of the 'All Tracks' node I only get 148 out of 24550 items on my test server), and entering a large number in the requestedCount field doesn't seem to make any difference, I still only get 148 items.
Call is as follows:

[[m_device contentDirectory] BrowseWithObjectID:m_rootId BrowseFlag:@"BrowseDirectChildren" Filter:@"*" StartingIndex:@"0" RequestedCount:@"0" SortCriteria:@"0" OutResult:outResult OutNumberReturned:outNumberReturned OutTotalMatches:outTotalMatches OutUpdateID:outUpdateID];

What's the best way to retrieve all the items in one request? Or will I need to make a number of sequential requests to retrieve all available items?

nick

DNamto

unread,
Apr 4, 2013, 3:12:18 AM4/4/13
to up...@googlegroups.com
Hi Nick,

I'm also trying to retrieve all the items in one request. But I don't want the user to navigate through the logical directory in the server. For example in my MyMusic Folder I have shared 3 files, but with current implementation the user is navigating through the logical directory based on meta information like All, Music, Genere, Artists etc. How can I modify the service call so that user reach directly to the files (Server->MyMusic->myfile.mp3). 

Any inputs in that direction will be extremely beneficial.

Thanks.

Nick Sturrock

unread,
Apr 4, 2013, 5:26:38 AM4/4/13
to up...@googlegroups.com
Hi

If you specify the rootID input to BrowseWithObjectID as the ID of the container (folder) where the files live this should immediately return you the file links you want in a single request. However this ID may change between sessions if the server has had new media added, so it may not be safe to hard code it - you should probably search for the container ID using the name of the folder if possible.

i.e. 

1. Search for ID of container 'All Tracks' or 'All Songs' (whatever it's called on your server) using SearchWithContainerID
2. BrowseWithObjectID for child objects (actual tracks) of the container - these should be the tracks themselves.

I think this should work,

Nick.
Reply all
Reply to author
Forward
0 new messages