Skip to content

Commit

Permalink
lyricwiki-qt: Make local and cached lrc files work again
Browse files Browse the repository at this point in the history
Regression from commit 48e5965.
  • Loading branch information
radioactiveman committed Dec 28, 2023
1 parent eb326e1 commit 9dbbf3f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lyricwiki-qt/lyricwiki.cc
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,7 @@ static void update_lyrics_window (const char * title, const char * artist, const
cursor.insertHtml (QString ("<big><b>") + QString (title) + QString ("</b></big>"));

if (artist)
{
cursor.insertHtml (QString ("<br><i>") + QString (artist) + QString ("</i>"));
}

cursor.insertHtml ("<br><br>");
cursor.insertText (lyrics);
Expand All @@ -466,6 +464,7 @@ static void lyricwiki_playback_began ()
Tuple tuple = aud_drct_get_tuple ();
g_state.title = tuple.get_str (Tuple::Title);
g_state.artist = tuple.get_str (Tuple::Artist);
g_state.lyrics = String ();

if (aud_get_bool ("lyricwiki", "split-title-on-chars"))
{
Expand Down Expand Up @@ -527,15 +526,16 @@ static void lyricwiki_playback_began ()
}
}

// No lyrics source - set default state
update_lyrics_window_notfound (g_state);
if (! g_state.lyrics)
update_lyrics_window_notfound (g_state);
}

static void lw_cleanup (QObject * object = nullptr)
{
g_state.filename = String ();
g_state.title = String ();
g_state.artist = String ();
g_state.lyrics = String ();

hook_dissociate ("tuple change", (HookFunction) lyricwiki_playback_began);
hook_dissociate ("playback ready", (HookFunction) lyricwiki_playback_began);
Expand Down

0 comments on commit 9dbbf3f

Please sign in to comment.