m0ngr31 / kanzi

Alexa skill for controlling Kodi
https://lexigr.am
MIT License
428 stars 149 forks source link

Unable to Find Movie in Search #248

Closed islipfd19 closed 6 years ago

islipfd19 commented 6 years ago

I'm not quite sure if this is an issue or not and I'll do my best to explain.

The instructions say to run the generate_custom_slots.py python script so that the user can fill in the results when setting up the skill. Now if a new movie is added to the database and not added to the MOVIES, the movie cannot be found and errors are produced. In this example I'm going to use the movie 'Frozen'. If this is the expected behavior, due let me know. What I'd like to do is attempt to perform the search against the kodi database and if found play the movie.

Example 1. Movie frozen not listed in the MOVIES slot.

Traceback (most recent call last): File "/usr/local/bin/kodi-alexa.test/test/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "/usr/local/bin/kodi-alexa.test/test/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/bin/kodi-alexa.test/test/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/bin/kodi-alexa.test/test/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/bin/kodi-alexa.test/test/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request return self.view_functionsrule.endpoint File "/usr/local/bin/kodi-alexa.test/test/local/lib/python2.7/site-packages/flask_ask/core.py", line 670, in _flask_view_func result = self._map_intent_to_view_func(self.request.intent)() File "/usr/local/bin/kodi-alexa.test/alexa.py", line 85, in decorated_function return f(*args, **kwargs) File "/usr/local/bin/kodi-alexa.test/alexa.py", line 2021, in alexa_watch_movie movie = kodi.FindMovie(Movie) File "/usr/local/bin/kodi-alexa.test/test/local/lib/python2.7/site-packages/kodi_voice/kodi.py", line 600, in FindMovie log.info('Searching for movie "%s"', heard_search.encode("utf-8")) AttributeError: 'NoneType' object has no attribute 'encode'

Example 2: With the movie frozen listed in the MOVIES slot. [2018-01-04 07:00:40 +0000] [11228] [DEBUG] POST / INFO:kodi_voice.cache:Initalizing INFO:kodi_voice.cache:Disabled INFO:kodi_alexa.alexa:Playing movie INFO:kodi_voice.kodi:Searching for movie "frozen" INFO:kodi_voice.kodi:Received request from device None INFO:kodi_voice.kodi:Sending request to http://192.168.1.160:8080/jsonrpc DEBUG:kodi_voice.kodi:{"params": {}, "jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "id": 1} INFO:kodi_voice.kodi:Trying to match: frozen INFO:kodi_voice.kodi:Simple match on direct comparison INFO:kodi_voice.kodi:BEST MATCH: "Frozen" INFO:kodi_voice.kodi:Received request from device None INFO:kodi_voice.kodi:Sending request to http://192.168.1.160:8080/jsonrpc DEBUG:kodi_voice.kodi:{"params": {"item": {"movieid": 2222}, "options": {"resume": true}}, "jsonrpc": "2.0", "method": "Player.Open", "id": 1} INFO:kodi_voice.kodi:Received request from device None INFO:kodi_voice.kodi:Sending request to http://192.168.1.160:8080/jsonrpc DEBUG:kodi_voice.kodi:{"params": {"movieid": 2222, "properties": ["resume", "trailer"]}, "jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "id": 1}

jingai commented 6 years ago

You should not need to add new movies to the slots. However, Amazon can sometimes 'eat' what it heard, especially on popular titles. There is no way for us to fix this though.

You don't say how you're asking for the movie, so I'm just guessing here that you're saying Alexa, ask Kodi to play Frozen. You might try any of the following and see if you get better results:

Alexa, ask Kodi to play the movie Frozen
Alexa, ask Kodi to watch Frozen
Alexa, ask Kodi to watch the movie Frozen

The simple answer for you, though, is: if it doesn't work without adding it to the slot, then add it to the slot. There's nothing else we can do if Amazon doesn't pass the term to the skill code.