Sludge Vohaul 23 Posted October 24, 2016 Posted October 24, 2016 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
ebr 16169 Posted October 24, 2016 Posted October 24, 2016 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.
Sludge Vohaul 23 Posted November 3, 2016 Author Posted November 3, 2016 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
Luke 42077 Posted November 3, 2016 Posted November 3, 2016 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 23 Posted November 3, 2016 Author Posted November 3, 2016 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 23 Posted November 3, 2016 Author Posted November 3, 2016 Ok, thanks for clarification. I'd then opt for a "deprecated usage" warning until next minor, and then an exception
Luke 42077 Posted November 3, 2016 Posted November 3, 2016 Deprecate what? The supported media types still apply
Sludge Vohaul 23 Posted November 12, 2016 Author Posted November 12, 2016 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.
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