ralph-irving / squeezeplay

Squeezeplay software player for Lyrion Music Server.
https://sourceforge.net/projects/lmsclients/files/squeezeplay/
50 stars 14 forks source link

NowPlaying settings updated very often (e.g. every minute) despite no changes #18

Closed stripwax closed 7 months ago

stripwax commented 1 year ago

https://github.com/ralph-irving/squeezeplay/blob/b4da1ca7d4e4f28e8a88aa59cc2be88362c22b3f/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua#L227

This storeSettings unfortunately gets triggered a lot, even when there are no changes to settings (noticed on modified time on userpath/settings/NowPlaying.lua and confirmed via logging) Perhaps the following would be better

                if settings.selectedStyle ~= self.selectedStyle then
                       settings.selectedStyle = self.selectedStyle
                       self:storeSettings()
                end

ref: https://www.jogglerwiki.com/forum/viewtopic.php?p=33593#p33593

The exact cause of the multiple regular calls to GetNPStyles() seems to be due to the call to self::showNowPlaying() in function openScreensaver() (or at least that's what I observed via logging the callstack around line 227). So maybe my suggestion only addresses the symptom, and the real fix would be elsewhere