johanpalmqvist / skill-squeezebox

Apache License 2.0
2 stars 4 forks source link

On initialize skill fails to load when no settings #2

Open LinusSkucas opened 5 years ago

LinusSkucas commented 5 years ago

When I try to load the skill with an empty settings.json file or a server that doesn't work, the skill completely fails to load. Maybe just check if the user has filled out the settings in home, and if they haven't, give them a message that they need to do so.

johanpalmqvist commented 5 years ago

More error handling and debug logging added. Please try it out.

sanderant commented 5 years ago

I'm having an issue where I had to re-install it fresh and it doesn't appear to be loading:

23:06:29.052 - skill-squeezebox_johanpalmqvist:load_library_total_duration:239 - INFO - Loading library total duration state
23:06:29.056 - skill-squeezebox_johanpalmqvist:load_library_total_duration:245 - INFO - Loaded library total duration state
23:06:29.059 - skill-squeezebox_johanpalmqvist:update_sources_cache:442 - INFO - Library total duration changed. Updating cache.
23:06:29.088 - skill-squeezebox_johanpalmqvist:load_library_total_duration:239 - INFO - Loading library total duration state
23:06:29.093 - skill-squeezebox_johanpalmqvist:load_library_total_duration:245 - INFO - Loaded library total duration state
23:06:29.097 - skill-squeezebox_johanpalmqvist:update_library_cache:419 - INFO - Library total duration unchanged. Not updating cache.
23:06:29.101 - skill-squeezebox_johanpalmqvist:load_library_cache:229 - INFO - Loading library cache
23:06:29.105 - skill-squeezebox_johanpalmqvist:load_library_cache:235 - ERROR -Library cache not found. Exception: Expecting value: line 1 column 1 (char 0)
23:06:29.874 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist.set'
23:06:29.884 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:IdentifyTrack.intent'
23:06:29.888 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:PowerOff.intent'
23:06:29.891 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:PowerOn.intent'
23:06:29.894 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:Stop.intent'
23:06:29.897 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:UpdateCache.intent'
23:06:29.900 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeDown.intent'
23:06:29.903 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeHalf.intent'
23:06:29.906 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeMax.intent'
23:06:29.910 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeMute.intent'
23:06:29.913 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeQuarter.intent'
23:06:29.917 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeThreeQuarters.intent'
23:06:29.920 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeUnmute.intent'
23:06:29.924 - mycroft.messagebus.client.ws:remove:159 - DEBUG - Removing found'skill-squeezebox.johanpalmqvist:VolumeUp.intent'
23:06:30.040 - mycroft.skills.core:load_skill:166 - ERROR - Failed to load skill: skill-squeezebox.johanpalmqvist
  File "/opt/mycroft/skills/skill-squeezebox.johanpalmqvist/__init__.py", line 78, in initialize
  File "/opt/mycroft/skills/skill-squeezebox.johanpalmqvist/__init__.py", line 99, in get_sources
  File "/opt/mycroft/skills/skill-squeezebox.johanpalmqvist/__init__.py", line 443, in update_sources_cache
  File "/opt/mycroft/skills/skill-squeezebox.johanpalmqvist/__init__.py", line 306, in save_sources_cache
AttributeError: 'SqueezeBoxMediaSkill' object has no attribute 'results'

Is this related? This is a new install with the media library not selected.

sanderant commented 5 years ago

Sorry I think this was from an incomplete scan after the initial settings being incorrect (e.g. trying to scan the media library and failing) which may not be related.