ptrk95 / MMM-MusicOnDemand

A module for the Magic Mirror using a music on demand service.
MIT License
7 stars 4 forks source link

"Play" and "Pause" works but "Flow" and "Loved" not. #15

Open lxne opened 3 years ago

lxne commented 3 years ago

The notifications for play, pause, previous, next are working. But I cannot get "Flow" or "Loved" to play. [update: "Artist" and "Title" also don't work.] Everything is running on a Pi4 with an up to date Buster and MM 2.13.0.

e.g. working:

notificationExec: {
                                notification: "AtMusicOnDemand",
                                payload: {
                                    message: "Play",
                                }
},

not working:

notificationExec: {
                                notification: "AtMusicOnDemand",
                                payload: {
                                    message: "Flow",
                                }
},
notificationExec: {
                                notification: "AtMusicOnDemand",
                                payload: {
                                    message: "Loved",
                                }
},

Any ideas would be welcome.

lxne commented 3 years ago

I got "Flow" working by changing line 314 in node_helper.js

original line: await self.page.evaluate(()=>document.querySelector('#page_content > div.channel > section:nth-child(1) > div.carousel > div:nth-child(2) > div.carousel-wrapper > div.carousel-inner > ul > figure:nth-child(1) > div.slide-foreground > ul > button').click());

edited line: await self.page.evaluate(()=>document.querySelector('#page_content > div.channel > section:nth-child(1) > div.carousel > div:nth-child(2) > div.carousel-wrapper > div.carousel-inner > ul > li:nth-child(1) > figure > ul > li > button‘).click());

Some insights: "Loved" seems a bit more complicated -> not working. When I try to play "Loved" the open chromium tab only changes to a Deezer subsite – nothing else happens. Because of being on another page afterwards "Flow" doesn't work anymore. I have to switch back to Deezer's main page manually. Then "Flow" works again.