Testing and Feedback for Kodi Skill

Good news! It works if I add the word movie :slight_smile: Still wrong Kodi though :smiley: Could there be some bug with updating settings?
also I have tried launching a tv show, but it plays the last movie played instead…

17:25:47.330 | INFO | 728 | mycroft.session:get:74 | New Session Start: 8cd10452-7731-405d-b15b-4c2bb669b8dc
17:25:47.334 | INFO | 728 | main:handle_wakeword:67 | Wakeword Detected: hey mycroft
Playing WAVE ‘/home/pi/mycroft-core/mycroft/res/snd/start_listening.wav’ : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
17:25:47.784 | INFO | 728 | main:handle_record_begin:37 | Begin Recording…
17:25:50.867 | INFO | 728 | main:handle_record_end:45 | End Recording…
17:25:52.177 | INFO | 728 | main:handle_utterance:72 | Utterance: [‘play friends season 1 episode 2’]
17:25:52.939 | INFO | 722 | Playback Control Skill | Resolving Player for: friends season 1 episode 2
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout

 17:25:55.850 | INFO     |   722 | cpkodi-skill_pcwii.kodi_tools.GetRequestedTVShows:get_show:75 | Removing Duplicate Entries
 17:25:55.852 | INFO     |   722 | cpkodi-skill_pcwii.kodi_tools.GetRequestedTVShows:get_tv_show:14 | Found ShowID: 149
~~~~8%3a8096%2femby%2fItems%2f3004%2fImages%2fPrimary%2f0%3fEnableImageEnhancers%3dTrue%26Tag%3d72ece7d830fd44e59a34c76fb6b6f8f3/'}]
~~~~by/kodi/tvshows/315/2983/file.strm?KodiId=7825&Name=friends.s01e02.ws.bdrip.xvid-ingot.avi&Id=2983', 'season': 1, 'episode': 2}]
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 17:26:00.186 | INFO     |   722 | Playback Control Skill | Playing with: cpkodi-skill.pcwii
~~~~ | INFO     |   722 | cpkodi-skill_pcwii.kodi_tools.CreatePlaylist:create_playlist:36 | [{"id":1,"jsonrpc":"2.0","result":"OK"}]
 17:26:00.636 | INFO     |   722 | Playback Control Skill | Audio service status: {}

Based on what you sent it looks like it found the friends episode you requested so that is good!
Can you try asking mycroft to “clear the kodi playlist” then try requesting the friends episode again? I only have one kodi instance installed. I will need to add this to my todo list so I can debug multiple instances. Currently the skill should use the kodi instance that is configured with the ip address in the mycroft settings screen. It is possible there is an issue with the skill settings updating.

Clearing the playlist worked. Do I have to do that every time now? :smiley:
Is there a way to check what info mycroft has from the skill configuration page?
Using this addon for multiple Kodis would be awesome, but I guess that is in the future.

1 Like

You should NOT have to clear the playlist each time. When a play request is ready to play the active playlist should be cleared then the new item added and played. Let me know If this isn’t working and I will investigate. I currently have an issue open on my Github to add multiple instances. I am in the process of rebuilding my media server so I have no content for Kodi at the moment, once I get things back online I will begin working on the multiple instances. I have some ideas on how to do this.

Then I guess the only way to change the kodi instance at the moment is to reinstall the skill?
Is there any way to deal with the “resume from” dialog that comes up when playing a previously unfinished movie? Tried the “move kodi cursor” commant. Doesn’t do anything.
Edit: after some usage I still have to clear the playlist manually if I want to start a TV show as it still plays the last movie instead of the tv show. Movies, however work fine.

Updating your instance IP address in the mycroft skills web configuration should work.

I think I know what this is, the TV shows use a different Playlist ID. I will look into this…

I have not tried this. I will see if I can figure a way around that.
Still early days, didn’t actually know anyone in the community was using this version of the skill yet. Thanks for testing.

That’s what I am trying to tell you - I did change it, but mycroft is ignoring it.

Well since I am a new user, I have to use the fresh stuff. Let me know if I can test something else for you.

Ok I will look into this, Mycroft does take a bit of time before refreshing the settings but I will ensure something else is not going on.
Thanks again for the feedback.

Definitely found an issue with self.settings_change_callback will correct in next release.

@enstain, I believe I have corrected the settings update issue as well as the clearing of the playlist before playback.
If the websettings are changed this should automatically get pushed to the skill. I also added a command “load kodi settings” to grab the latest from the websettings.

  • Still need to investigate the “resume play” dialog
  • Multiple instances is going to take a bit more work.
    Let me know if you have success with these two changes.

Mmm. The update command works, but now it won’t play anything. Tried movie, tv show and youtube. Did I need to do something to get the skill updated?

The “resume play” could be solved with a command to press ok/select button or if it is possible to detect such a dialog the mycroft could ask if you want to resume or restart…

Output:
08:36:50.103 | INFO | 728 | main:handle_wakeword:67 | Wakeword Detected: hey mycroft
Playing WAVE ‘/home/pi/mycroft-core/mycroft/res/snd/start_listening.wav’ : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
08:36:50.556 | INFO | 728 | main:handle_record_begin:37 | Begin Recording…
08:36:52.867 | INFO | 728 | main:handle_record_end:45 | End Recording…
08:36:54.322 | INFO | 728 | main:handle_utterance:72 | Utterance: [‘play movie iron man’]
Checking (‘wash the dishes’, ‘20210302-210000-+0200’)
08:36:54.793 | INFO | 722 | Playback Control Skill | Resolving Player for: movie iron man
08:36:57.121 | INFO | 722 | cpkodi-skill_pcwii:dLOG:95 | CPKodiSkill received the following phrase: movie iron man
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
08:36:57.148 | INFO | 722 | cpkodi-skill_pcwii:dLOG:95 | Using Regex: cast.type

Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 66, in wrapper
    handler(message)
  File "/home/pi/mycroft-core/mycroft/skills/common_play_skill.py", line 96, in __handle_play_query
    result = self.CPS_match_query_phrase(search_phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 369, in CPS_match_query_phrase
    request_data = self.get_request_info(phrase)  # Parse the utterance (phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 217, in get_request_info
    cast_type = re.match(self.translate_regex('cast.type'), phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 154, in translate_regex
    with open(path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/mycroft/skills/cpkodi-skill.pcwii/./json_objects/cast.type.rx'
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 08:37:02.489 | INFO     |   722 | Playback Control Skill |    No matches

08:35:02.916 | INFO     |   728 | __main__:handle_wakeword:67 | Wakeword Detected: hey mycroft
Playing WAVE '/home/pi/mycroft-core/mycroft/res/snd/start_listening.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
 08:35:03.374 | INFO     |   728 | __main__:handle_record_begin:37 | Begin Recording...
 08:35:06.204 | INFO     |   728 | __main__:handle_record_end:45 | End Recording...
 08:35:07.675 | INFO     |   728 | __main__:handle_utterance:72 | Utterance: ['play queen from youtube']
Checking ('wash the dishes', '20210302-210000-+0200')
 08:35:08.161 | INFO     |   722 | Playback Control Skill | Resolving Player for: queen from youtube
 08:35:10.519 | INFO     |   722 | cpkodi-skill_pcwii:dLOG:95 | CPKodiSkill received the following phrase: queen from youtube
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 08:35:10.535 | INFO     |   722 | cpkodi-skill_pcwii:dLOG:95 | Using Regex: cast.type
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
~~~~   722 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:835 | An error occurred while processing a request in CP Kodi Skill
Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 66, in wrapper
    handler(message)
  File "/home/pi/mycroft-core/mycroft/skills/common_play_skill.py", line 96, in __handle_play_query
    result = self.CPS_match_query_phrase(search_phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 369, in CPS_match_query_phrase
    request_data = self.get_request_info(phrase)  # Parse the utterance (phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 217, in get_request_info
    cast_type = re.match(self.translate_regex('cast.type'), phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 154, in translate_regex
    with open(path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/mycroft/skills/cpkodi-skill.pcwii/./json_objects/cast.type.rx'
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 08:35:15.320 | INFO     |   722 | Playback Control Skill |    No matches

I think I know what happened here. I merged my dev branch and I did quite a bit of refactoring on files to clean things up, I think the mycroft did not update the skill files very well.
I would try two things.

  1. Try rebooting your mycroft unit and see if that corrects the problem.
  2. If that doesn’t work you will need to uninstall then re-install the skill.

This should not be a regular occurrence when upgrading but it is due to the substantial number of updates in my dev branch that I merged.

Will do when I get back home. Can you point me to how to uninstall a skill?

If you can ssh into your mycroft you will need to drop out of the cli-client with ^c
Then you will issue the following commands
To Remove
msm remove cpkodi-skill
To Install
msm install https://github.com/pcwii/cpkodi-skill.git
This should clean things up for you, and get you back up.
After installing you will need to re-configure the websettings in the mycroft.ai home page.

Hey, tried everything- rebooting, uninstalling, rebooting, installing and so on still doesn’t work.

18:07:32.685 | INFO | 3295 | main:handle_wakeword:67 | Wakeword Detected: hey mycroft
Playing WAVE ‘/home/pi/mycroft-core/mycroft/res/snd/start_listening.wav’ : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
18:07:33.147 | INFO | 3295 | main:handle_record_begin:37 | Begin Recording…
18:07:35.133 | INFO | 3295 | main:handle_record_end:45 | End Recording…
18:07:36.217 | INFO | 3295 | main:handle_utterance:72 | Utterance: [‘play movie iron man’]
18:07:36.490 | INFO | 1999 | Playback Control Skill | Resolving Player for: movie iron man
18:07:39.513 | INFO | 1999 | cpkodi-skill_pcwii:dLOG:95 | CPKodiSkill received the following phrase: movie iron man
18:07:39.516 | INFO | 1999 | cpkodi-skill_pcwii:dLOG:95 | Using Regex: cast.type
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout

Traceback (most recent call last):
  File "/home/pi/mycroft-core/mycroft/skills/mycroft_skill/event_container.py", line 66, in wrapper
    handler(message)
  File "/home/pi/mycroft-core/mycroft/skills/common_play_skill.py", line 96, in __handle_play_query
    result = self.CPS_match_query_phrase(search_phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 369, in CPS_match_query_phrase
    request_data = self.get_request_info(phrase)  # Parse the utterance (phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 217, in get_request_info
    cast_type = re.match(self.translate_regex('cast.type'), phrase)
  File "/opt/mycroft/skills/cpkodi-skill.pcwii/__init__.py", line 154, in translate_regex
    with open(path) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/mycroft/skills/cpkodi-skill.pcwii/./json_objects/cast.type.rx'
Checking ['wash the dishes', '20210302-210000-+0200']
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 18:07:44.095 | INFO     |  1999 | Playback Control Skill |    No matches

Ok, Thanks for the effort, I will have to dig into it later this evening after work.
Think I know what the issues is.

Will be waiting for the update :slight_smile:

I think I solved this one (at least for now, there is a language issue I will need to address at some point). I expect there will be other issues that crop up as I continue to debug and test. Let me know if you run into other issues. Definitely appreciate another set of eyes running this skill through it’s paces.
Changes should get pulled automatically but if you need you can ssh and run msm update and that will manually pull the changes.
Enjoy!

1 Like

Great. Seems to be working so far. I will get back to you if I run into some issues. I have also another feature suggestion - would it be possible to have it play the next unwatched episode instead of listing of season and episode number? with something like “play friends next episode”. I would be nice, since usually I don’t remember what was the number of the last episode I watched… :slight_smile:

Now to figure out what is wrong with youtube plugin. It works on one kodi, but not on another :smiley:

2 Likes

You can find instructions to installing the youtube plugin from links in my readme file.