mihirlad55 / polybar-spotify-module

A collection of lightweight programs for use with a Polybar Spotify Module
GNU General Public License v3.0
140 stars 9 forks source link

Fix trackid comparison #28

Closed FryDay closed 2 years ago

FryDay commented 2 years ago

Fixes #26

FryDay commented 2 years ago

@mihirlad55 If we could get this reviewed and merged, it would fix everyone's issues that use the AUR package. As it stands, the module is completely broken.

mihirlad55 commented 2 years ago

I'm gonna be busy today, but I'll try to review tomorrow. Thanks for the PR

mihirlad55 commented 2 years ago

I reviewed the PR and tested the module. This seems to be 90% of a fix. It fixes the issue with not detecting spotify, so the polybar module will show the player controls and track info. Also, the track info will automatically be updated as the track changes and the controls work for playing/pausing and going to the next/previous track. The only thing that seems to not work is updating the module when the song Play/Pause status is changed (i.e. change pause icon to play when the song is paused and vice versa).

Comparing the DBus messaging changes by spotify with previous versions, it seems spotify no longer publishes Metadata information when the track status changes. As a result, the is_spotify check in the code fails, and the following block of code never runs:

https://github.com/mihirlad55/polybar-spotify-module/blob/master/src/spotify-listener.c#L217-L235

which is the block of code responsible for notifying the polybar module with whether or not the song is currently playing/paused.

mihirlad55 commented 2 years ago

I think what I'll do is merge this in, so people have at least a mostly functioning module. And we can work on a fix for the rest of the issue. I'll keep the linked issue open until the module is fully fixed.