Add support for searching media to Kodi - #161681
Conversation
|
Hey there @OnFreund, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
1d681d7 to
26bbb7f
Compare
26bbb7f to
db062a3
Compare
Kodi provides a mechanism to query the available movies, TV shows etc using jsonrpc. This change adds a logic to match them against the search query using rapidfuzz. This change only adds the support for searching movies and TV shows. I do not have music hosted in my kodi instance to test it. But the logic can be extended in the same way. The search behaviour is as follows: For movies, return the matching movie(s). For TV shows, return the first unwatched episode for the matching show(s). Sample usage: "Play Avengers on Kodi" "Play Brooklyn nine nine on Kodi"
db062a3 to
1028f23
Compare
If the requester (say an llm conversation agent) sends an invalid value for media class (e.g. 'tv' instead of 'tv_show') the current logic will filter it out entirely. Instead we can default to the allowed list when this happens.
joostlek
left a comment
There was a problem hiding this comment.
So while I think this is a neat change, I consider the matching of the titles a service specific, so would it make sense to move this to pykodi? The library seems to be maintained by codeowners, so we might be able to move it there and make our code less service specific
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
I would normally agree with you. However, the pykodi library does not seem to be maintained. The last checkin was almost 3 years ago. |
|
Sent the maintainer a message |
|
He just said he's open to such a PR :) |
|
Thanks! Will update. |
|
I have created a PR in PyKodi. OnFreund/PyKodi#21 |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
I have created a PR in PyKodi. OnFreund/PyKodi#21 |
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
I have created a PR in PyKodi. OnFreund/PyKodi#21 |
Kodi provides a mechanism to query the available movies, TV shows etc using jsonrpc.
This change adds a logic to match them against the search query using rapidfuzz.
This change only adds the support for searching movies and TV shows. I do not have music hosted in my kodi instance to test it. But the logic can be extended in the same way.
The search behaviour is as follows:
For movies, return the matching movie(s).
For TV shows, return the first unwatched episode for the matching show(s).
Sample usage:
"Play Avengers on Kodi"
"Play Brooklyn nine nine on Kodi"
Proposed change
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: