foo_openlyrics icon indicating copy to clipboard operation
foo_openlyrics copied to clipboard

Local lyrics are not displayed when switching panel visibility

Open regorxxx opened this issue 10 months ago • 5 comments

Foobar v1.6.18 and openlyrics 1.12

Not sure if this is a bug or just an omission in your design logic.

The default behavior is that no search is performed when the panel is not visible. That's ok for online sources.

But it seems it also applies to lyrics from files and tags. Therefore, if you have the panel on a hidden tab, if you start playback and then open the tab, it shows no lyrics (since no search was performed), even if there is zero need to search anything since the lyrics are already present at the file.

I see there are multiple possibilities:

  1. The panel could automatically perform a search after switching visibility if it was hidden first (and thus no lyrics shown yet). I may agree there is no need to search lyrics if nothing is shown, but then we may also see the expectation is to see something when the panel is shown (so a search at that point makes sense).
  2. Or local lyrics should always be searched even if the panel is hidden, so they would be displayed in these cases even if no online search was performed (following the preferences setting for hidden panels). This is a good minimum, since at least local lyrics should be available.

I would say in any case the current behavior is not desirable or expected, since -as user- I would expect "search" to refer to online searching. And local lyrics should always display in any case when I open the panel.

Neither 1 nor 2 do anything which contradicts the available hidden panel setting behavior.

See the gif for the "problem".

Image

Note even if the file has lyrics tags, when I double click to restart playback on the same track, it doesn't force a lyric search. Only when I switch to another track and then to the same track, it looks for the local tags. (or if I stop playback)

I have tested it with the "search with hidden panel" setting enabled, and obviously it works fine in such case.

regorxxx avatar Feb 21 '25 19:02 regorxxx

Ah, can you check/upload debug logs of this happening? I suspect it is searching, it's just not picking it up when the panel becomes visible.

I also expect this is not at new in v1.12

jacquesh avatar Feb 21 '25 20:02 jacquesh

Nope, this has been present on previous releases. I was not understanding many times why I had no lyrics even if they were on files, and just now I was able to reproduce and understand the behavior.

Playback with panel on not visible tab

Opening track for playback: "H:\Musica_Web\Samurai\Artilleria {2023 Tidal 299053306}\05 - Mechero.flac" Using decoder shim instead of DSP: Skip Track Skip Track found partial skip info from tags INFO-OpenLyrics: Skipping new-playback search. The track has changed, we're not waiting for dynamic track info, there are no visible openlyrics panels INFO-OpenLyrics: New album art data retrieved INFO-OpenLyrics: LyricPanel::compute_background_image took 59940us INFO-OpenLyrics: LyricPanel::on_album_art_retrieved took 68200us Biography Server: wikipedia: Samuraï: not found Seekbar: Analysis file path -> .\js_data\seekbar\samurai\artilleria {2023 tidal 299053306}\05 - mechero.aw.lz16 HDD wakeup - touching file: H:{A53AE67A-5343-4E7C-9C19-63BC430EA8C7} HDD wakeup - touched file: H:{A53AE67A-5343-4E7C-9C19-63BC430EA8C7} Biography Server: wikipedia: Artillería: not found

Switching to lyrics tab

INFO-OpenLyrics: LyricPanel::compute_background_image took 37956us

Stop and playing track again with visible tab

Opening track for playback: "H:\Musica_Web\Samurai\Artilleria {2023 Tidal 299053306}\05 - Mechero.flac" Using decoder shim instead of DSP: Skip Track Skip Track found partial skip info from tags INFO-OpenLyrics: No search avoidance info available for track INFO-OpenLyrics: Searching for lyrics for artist='Samuraï', album='Artillería', title='Mechero'... INFO-OpenLyrics: Save file name format '[%Track% - ][$ascii($replace(%title%,,,/,))]' with directory class 'Custom('H:_lyrics$directory(%path%,2)$directory(%path%,1)\lyrics')' evaluated to 'H:_lyrics\Samurai\Artilleria {2023 Tidal 299053306}\lyrics\05 - Mechero' INFO-OpenLyrics: Querying for lyrics in H:_lyrics\Samurai\Artilleria {2023 Tidal 299053306}\lyrics\05 - Mechero.lrc... INFO-OpenLyrics: Querying for lyrics in H:_lyrics\Samurai\Artilleria {2023 Tidal 299053306}\lyrics\05 - Mechero.txt... INFO-OpenLyrics: Found 0 lyrics in local files: H:_lyrics\Samurai\Artilleria {2023 Tidal 299053306}\lyrics\05 - Mechero INFO-OpenLyrics: Failed to retrieve lyrics from source: Local files INFO-OpenLyrics: Searching for lyrics in tag: 'LYRICS' INFO-OpenLyrics: Found lyrics in tag: 'LYRICS' INFO-OpenLyrics: Parsing LRC lyric text... INFO-OpenLyrics: Searching for lyrics in tag: 'SYNCEDLYRICS' INFO-OpenLyrics: Searching for lyrics in tag: 'UNSYNCED LYRICS' INFO-OpenLyrics: Searching for lyrics in tag: 'UNSYNCEDLYRICS' INFO-OpenLyrics: Successfully retrieved lyrics from source: Metadata tags INFO-OpenLyrics: Parsing lyrics text... INFO-OpenLyrics: Loaded lyrics already form a valid UTF-8 sequence INFO-OpenLyrics: Parsing LRC lyric text... INFO-OpenLyrics: Lyric loading complete INFO-OpenLyrics: New album art data retrieved INFO-OpenLyrics: LyricPanel::compute_background_image took 46298us INFO-OpenLyrics: LyricPanel::on_album_art_retrieved took 53460us INFO-OpenLyrics: Skipping lyric save. Type: 1, Local: yes, Timestamped: yes, Autosave: 1

I would say it only searches if initially visible, not at switching.

regorxxx avatar Feb 21 '25 23:02 regorxxx

I would say it only searches if initially visible, not at switching.

Yeah searches aren't currently triggered when a panel becomes visible. We could consider adding it but that might be a bit more complicated than it used to be now that searches have been taken out of the panel code to support searching when no panels are visible.

That said, I agree there isn't much reason not to at least search the local sources and off the top of my head I would have said that's what we were doing but...clearly not. Woops.

Historically I've not worried too much about there not being lyrics when a panel is created because you're not usually changing your layout, but tabs are a different story so that's a fair callout.

jacquesh avatar Feb 22 '25 13:02 jacquesh

Historically I've not worried too much about there not being lyrics when a panel is created because you're not usually changing your layout, but tabs are a different story so that's a fair callout.

I agree with this.

Note CUI also allows to witch panel visibility by L. Clicking at the left area, so layouts where horizontal elements may be hidden (thus actually changing the layout) are also possible -without tabs-. And I would say that's particularly useful for lyrics or biography panels, since you may only want to see them on playback but hidden while managing the library or tagging.

regorxxx avatar Feb 22 '25 14:02 regorxxx

I have lyrics panels in separate tabs in the sidebar (with DUI) and was confused when the OpenLyrics tab didn't show anything. I constantly switch between the tabs (DSP/Lyrics3/OpenLyrics/Playlists/Log) and OpenLyrics requiring 2 extra clicks after a tab switch is very inconvenient.

That said, I agree there isn't much reason not to at least search the local sources and off the top of my head I would have said that's what we were doing but...clearly not. Woops.

I don't think performing local searches when the panel is invisible matters — normally, it's nearly instant.

What I'd like is Lyrics3's behavior of searching all sources as usual when the panel becomes visible. There shouldn't be any difference whether switching a track or showing a panel comes first — in both cases, the track should be playing and the lyrics scrolling.

Athari avatar Apr 28 '25 17:04 Athari

@regorxxx can you please check if this works with the "Automatically search for lyrics even with no visible openlyrics panels" option enabled (Tools -> OpenLyrics -> Searching).

Works for me locally, at least with default UI (when a panel is on a unselected tab, Windows reports it as "not visible").

jacquesh avatar Sep 20 '25 13:09 jacquesh

Confirmed it works as soon as I enable that option (CUI).

regorxxx avatar Sep 20 '25 13:09 regorxxx

Fantastic, thanks!

jacquesh avatar Sep 20 '25 13:09 jacquesh

I would recommend to add some kind of note about it at the preferences panel though. Specifying it also applies to local files, not only online searches.

Thanks!

regorxxx avatar Sep 20 '25 13:09 regorxxx

Oh excellent idea, it's not really meant to apply to local sources. I've made that change now so it'll still search local files. I've updated the label on the preferences page to clarify that it only applies to remote sources.

jacquesh avatar Sep 20 '25 14:09 jacquesh