pcwii/cpkodi-skill

Multiple instances?

Opened this issue · 3 comments

Is it possible to configure and use multiple Kodi instances?

pcwii commented

Currently this is not possible. It could be though. I have thought about this in the past but am not sure how you would define which instance to send to. I have a few questions on how this would work. Do you share your library between kodi devices? This is possibly important since the libraryID of each item may be different depending on the kodi instance that is queried. eg. If you request to play a movie. What device kodi device would I query to retrieve the libraryID. On two different devices this libraryID may be different for the same library item (I would need to confirm this). Would you be ok with making the movie (or other) request then having mycroft ask what device to send it to as the last interaction before playing? Or if multiple instances are configured do I request which instance to use at the time a Play request is made? Thanks for contributing, I am getting close to releasing this to the community.

Hey, excellent questions. It seems like the idea of the common play framework is to find all possible targets for a request right? So I I want music it can be offered by spotify and kodi for example. How would Mycroft handle that? Would it ask for which device to play on? I think ideally you would have two Kodi play targets and if the common play finds two targets for your series, movie or whatever It can then ask on which device to play (just like if it was offering a Spotify and kodi possiblity).

I do not share my library, I think that both your options for choosing the device are fine (when making the request or Mycroft answering).I think it would be best to stay as close to the common play implementation as possible

Thanks for the excellent work!

pcwii commented

My understanding of the CP framework is as follows. All "play" requests are funneled through the CP framework and any skill that is registered as a CPS is provided the "play" request. Next each skill is required to reply to the framework with a "probability" that it is capable of handling the request. The framework then decides base don the "probability" who should play the request. The problem with the current CP skills that I have reviewed is that they Do NOT actually confirm that they can play the request before replying to the framework with their probability. Many of the skills just determine if the request matches their exceptable requests and then replay with a high "probability", They don't actually confirm that the request is currently in the library, or available online. I try to ensure that the item that is requested actually exists in the kodi library and is playable before returning the probability. As far as multiple instances go, if there are multiple instances of kodi registered with the cpkodi skill then each registered device would need to reply back to the cpkodi skill with it's own "probability" to play the skill. In the event that only one instance was capable of playing the request then that instance would default to play. If multiple instances replied back to the cpkodi skill that they are capable of playing the request then user intervention would be required to determine which device should play the request. I think this is doable but I will need to think it through a bit more (and setup another kodi instance so I can test). I have a couple items to clean up, but I will keep this request open and see if I can get it added.