Jump to content

ApiClient; ItemQuery.IncludeItemTypes


Recommended Posts

Sludge Vohaul
Posted

Hi,

 

if I wanted get a list of all photos and movies in the library would I have to write

var asd = new ItemQuery
{
   IncludeItemTypes = new [] { MediaType.Photo, "Movie" }
}

as there is no Movie-Property in MediaType ?

Is using MediaType the right way, at all?

Posted

Media Types and Item Types are different.  Media types are more inclusive.  For instance, the Item Types Video and Movie are both of Media Type Video.

 

So, while the above may work by coincidence, you should just use the strings "Photo" and "Movie".

 

Also, you should never fire off that query just like that as it will likely bring your server to its knees and could take quite a while to return.  If you really need to get all of those items, be sure to put a limit on the query and page them in.

Sludge Vohaul
Posted

Media Types and Item Types are different.  Media types are more inclusive.  For instance, the Item Types Video and Movie are both of Media Type Video.

 

So, while the above may work by coincidence, you should just use the strings "Photo" and "Movie".

 

Also, you should never fire off that query just like that as it will likely bring your server to its knees and could take quite a while to return.  If you really need to get all of those items, be sure to put a limit on the query and page them in.

 

 

Thank you for the clarification on item Types.

Regarding the query it was just an example, I am not planing to fetch all items of a type together.

 

--

sv 

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...