SpotiWeb
SpotiWeb copied to clipboard
notifications problems
In many cases the gnome-notification pops up multiple times for a single song -> see screenshot
@Steindi01 Can you give me more details about your system so that I can try to replicate the issue on my side?
I'm using Fedora 22 with Gnome Version 3.16.2. Further the cover from the album-art does sometimes not match the actual song in the gnome notification and falls behind one step. In other words: if I start song A and go to the next one (song B), than the notification shows the title of song B with the cover of song A.
Same store here with Xubuntu 16.04
Not sure what's the pattern, sometimes displays two notifications or just one. On this occasion has displayed three and the art of the first corresponds to the previous played song.
And I'm not sure about is a gnome-notifications problem, AFAIK Xubuntu uses xfce4-notifyd to display notifications.
The problem seems to be on the title event handler. Doing this:
mainWindow.on('page-title-updated', function(e,t){
console.log('title:', t);
I realised the title changes three times on the spotify site, but just sometimes (no idea why). For example this was the title of a played song:
title: ▶ Left Behind - Slipknot - Spotify
then when starts to play the next song, it changes to:
title: Left Behind - Slipknot - Spotify
then again to this:
title: ▶ Left Behind - Slipknot - Spotify
and finally the corresponding title of the new song:
title: ▶ Wake Up - Remastered - Rage Against The Machine - Spotify
So up this moment has been invoked setTimeout
three times to notify the new song in the next 2 seconds, which it will be Wake Up - Remastered - Rage Against The Machine - Spotify
. Maybe saving the last title and comparing it with the new one would fix this? Or maybe electron has a better way to handle this? (Never heard about electron up now, so I'm clueless)
I know... This is a very hacky way to do it, but it was the only one I could find. The only problem with your suggestion is the use case where the user pauses a song and then starts playback again, the song title would be the same... I've been searching about this and notifications on Linux appear to be a bit buggy, I think I've found a solution, it'll be on the next release soon. Basically, I'm creating new notifications for every page title change, my solution is to reuse the notification by closing it first, changing the attributes and then showing it again.
@Steindi01 @alagos Hi there, can you check if this problem persists in SpotiWeb v0.5?
The new version gets rid of the duplicates, but in many cases there is no album cover displayed.
This only happens if I choose a particular song. When a new song begins from the queue, then the notification works fine.
Windows 7, happens when I play\pause with media keys. Pausing with mouse doesn't produce this bug.