skuethe / MMM-Spotify

Spotify display and controller for MagicMirror
MIT License
68 stars 17 forks source link

MMM-SPOTIFY response #128

Closed flyinstefan closed 3 years ago

flyinstefan commented 3 years ago

Hi, first of all, since i'm new here, I would like to thank all developers for the effort they put in all those projects. It's amazing what you can do with the community projects.

I figured there is an issue, when you use SPOTIFY_SEARCH and the result contains only 1 Object. Then, the item is not played. If Items is > 1, it is played. Having only 1 item in the result is actually a good thing, since your search was very precise obviously.

LOG: [17.01.2021 15:31.56.006] [LOG] magicmirror [17.01.2021 15:31.56.070] [LOG] {"type": "album", "query": "strainful train vol 3", "random": false} [17.01.2021 15:31.56.124] [LOG] Ich spiele das Album strainful train vol 3. [17.01.2021 15:31.56.279] [LOG] 200 null { albums: { href: 'https://api.spotify.com/v1/search?query=strainful+train+vol+3&type=album&offset=0&limit=50', items: [ [Object] ], limit: 50, next: null, offset: 0, previous: null, total: 1 } } It seems that in node_helper.je line 272 is responsible. if (result[section] && result[section].items.length > 1) { I changed it locally to if (result[section] && result[section].items.length > 0) {

Not sure why it's there and what other implications it might have.

Thanks a lot

skuethe commented 3 years ago

Hey there. Thank you for opening an issue and providing the details, that helps a lot. So I assume with your local change to result[section].items.length > 0 it is working just fine? If so, I would just patch that. To be honest, I have never used the search option :D

I would also think that this is just a typo and has no other implications. It was introduced in this commit and has never been anything other than > 1: https://github.com/skuethe/MMM-Spotify/commit/5f06e0206c4629c40c35c7b16de0a38dbf5f3bcd#diff-c3af8f7a6be304d4d15ed69f565b5bc2d8bdb4fc3a4b79e6f1814e36cd4d2afbR157

flyinstefan commented 3 years ago

Hi, yes it works fine. There is another issue, where the module starts sending notifications like crazy, also when the ui part is not visible. Once i managed to reproduce it, i can file another issue. I use the search with kalliope voice Assistent. its amazing, starts a genre, artist on voice command and turns on the Stereo. However ,thanks for taking are

skuethe commented 3 years ago

I'll reopen the issue until I fix it in an PR. Currently having PC problems, so it will take some time. Thanks again for opening the issue.

About the notification spam: I think I already know what's going on. You can go ahead and try the feature/offlineAccountSwitch branch. I started reworking a lot of stuff there

flyinstefan commented 3 years ago

Thanks, i will try with the branch. Today my API access was shut down, due to reaching a request limit for "me/player". It seems that if the app does not play for some time and then is closed after some time, MMM_Spotify is sending requests all the time. image

skuethe commented 3 years ago

that is unfortunate. I hope they allow you access again after some time. Please verify your idleTimeout value in the mm config. increase it if necessary to avoid being shutdown because of too many requests.

flyinstefan commented 3 years ago

With the new branch it looks much better. Requests are back to normal. I installed it the day before yesterday Thanks