rusconi / TFT-MoodeCoverArt

Display artwork and some metadata from moode audio on a 240*240 ST7789 TFT
13 stars 9 forks source link

Crash after connectig via Bluetooth #8

Open Orestos opened 2 years ago

Orestos commented 2 years ago

Script crash after connecting via Bluetooth, After stopping the Service and trying to start the script manually i get this:

Traceback (most recent call last):
  File "/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py", line 398, in <module>
    main()
  File "/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py", line 240, in main
    moode_meta = getMoodeMetadata(filename)
  File "/home/pi/TFT-MoodeCoverArt/tft_moode_coverart.py", line 143, in getMoodeMetadata
    metaDict['coverurl'] = urllib.parse.unquote(metaDict['coverurl'])
KeyError: 'coverurl'

After disconneting bluetooth i can start the script without problems. i checked if the metafile would be updated and it is - i think there is a problem with this script.

Orestos commented 2 years ago

Same problem as connecting via Spotify

Orestos commented 2 years ago

Isue ist somewhere in line 143

metaDict['coverurl'] = urllib.parse.unquote(metaDict['coverurl'])

i commented it out and it went well - without display cover anymore.

Orestos commented 2 years ago

solution: i moved the line metaDict['coverurl'] = urllib.parse.unquote(metaDict['coverurl']) down to line 165 and did:

if metaDict['source'} == 'radio': metaDict['coverurl'] = urllib.parse.unquote(metaDict['coverurl'])

now it runs very well :)

my first time doing something in python, so i dont know if everythins is nice. perhaps source library didn't work that way, but i dont use it. only Radio, Bluetooth, spotify and snapclient :)