forslund / spotify-skill

Mycroft Skill to control spotify using the Spotify Connect API
Apache License 2.0
71 stars 38 forks source link

Spotify in spanish (es-es) not playing songs #147

Closed rs13885 closed 4 years ago

rs13885 commented 4 years ago

I've setup Mycroft to work in spanish, but I can't make the Spotify skill to play some music. I've tested with asking for the available devices with the "dispositivos spotify" (spotify devices) intent, and it returned the connected devices as expected. However, when I say "reproduce norah jones en spotify" (play norah jones in spotify), it just returns the error below, saying that there was an error processing a petition from Spotify Skill, and at the end mentions something about some unbalanced parenthesis:

 21:46:44.870 | INFO     | 15256 | mycroft.util:wait_while_speaking:58 | mycroft.utils.wait_while_speaking() is depreciated, use mycroft.audio.wait_while_speaking() instead.
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 21:46:48.435 | ERROR    | 15256 | mycroft.skills.mycroft_skill.mycroft_skill:on_error:835 | Sucedió un error al procesar una petición de Spotify 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 80, in __handle_play_query
    result = self.CPS_match_query_phrase(search_phrase)
  File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 425, in CPS_match_query_phrase
    confidence, data = self.specific_query(phrase, bonus)
  File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 508, in specific_query
    match = re.match(self.translate_regex('artist'), phrase)
  File "/usr/lib/python3.7/re.py", line 173, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib/python3.7/re.py", line 286, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
    p = sre_parse.parse(p, flags)
  File "/usr/lib/python3.7/sre_parse.py", line 944, in parse
    raise source.error("unbalanced parenthesis")
re.error: unbalanced parenthesis at position 78
Removing event mycroft-spotify.forslund:launch_librespot
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 21:46:53.316 | INFO     | 15256 | Playback Control Skill |    No matches

Do you know what could be causing this? If I use Mycroft in english it works perfectly, however I would like to be able to use it in spanish. Please let me know if you need further details from my side.

Thanks!

forslund commented 4 years ago

Hi, looks like there's been a mistake in one of the regex translations. Let me check on it and see if I can find which one.

forslund commented 4 years ago

I found an error with the artist regex as your logs suggests. I've pushed a branch bugfix/es-es with a fix (I think)

Can you try it out?

You can switch to the branch by running

cd /opt/mycroft/skills/mycroft-spotify.forslund
git fetch
git checkout bugfix/es-es
rs13885 commented 4 years ago

It works perfectly with that fix! Thank you!

forslund commented 4 years ago

Excellent, thanks for testing!