Jump to content

ApiClient; ClientCapabilities


Recommended Posts

Sludge Vohaul
Posted

Hi,
 
I am new to the whole API, but I expected my client with the following configuration
 

var caps = new ClientCapabilities
{
   PlayableMediaTypes = new List<string> {"Movies"}
}
_myApiClient.ReportCapabilities(caps)

to return only movies from a query

_myApiClient.GetItemsAsync(new ItemQuery 
{
...
});

This is not the case. Do I have a misunderstanding in the design, or is this behaviour simply not implemented?

 

Thanks in advance,

sv

 

Posted

The capabilities determine which remote control commands the client can accept.  If you want limited results from queries you will need to use the ItemTypes.

  • 2 weeks later...
Sludge Vohaul
Posted

The capabilities determine which remote control commands the client can accept.  If you want limited results from queries you will need to use the ItemTypes.

 

Hm, makes sense. But shouldn't then my example code above raise an exception (something like an InvalidMediaTypeException), as "Movie" is not a MediaType but an ItemType? The correct MediaType would be "Videos". Or are there any cases where a client could possibly play movies, but not home videos? (just curious...).

 

Thanks,

sv

Posted

Perhaps it should throw an error, it just hasn't really come up before. It is all based on primitive media type though, we do but distinguish between types of video at this stage

Sludge Vohaul
Posted

Sorry I am not really understanding "...we do but distinguish between types of video at this stage"  - does it mean you do distinguish between different video types, or you don't?

Sludge Vohaul
Posted

Ok, thanks for clarification. I'd then opt for a "deprecated usage" warning until next minor, and then an exception :)

Posted

Deprecate what? The supported media types still apply

  • 2 weeks later...
Sludge Vohaul
Posted

Hi, sorry for the delay.

I meant to introduce a deprecated warning for everything that is not exactly matched by the media type enums or constants in the code (don't have the sources here right now, so I can't tell you where it is).  The string "Movies" for example is regarded as a valid media type due to an additional  string comparison. On the other hand "CoolMovies" is not regarded as a valid media type, as there is no additional check for this string. I suggested to be more strict and accept only the defined media types (which "Movies" is not). For a few releases I'd introduce a warning, and later on I'd reject invalid strings.

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