From: Max Kellermann Date: Tue, 23 Sep 2008 10:08:14 +0000 (+0200) Subject: screen_lyrics: set current.song X-Git-Tag: v0.12_alpha1~179 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=31d7b47521f6663ccb30d36ae7b0ac8ed0c3127f;p=ncmpc.git screen_lyrics: set current.song The variable current.song was never set, thus the cache did not work. Don't reset it in screen_lyrics_clear() (which is called from screen_lyrics_set()). --- diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index c2c7807..cfc6589 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -79,8 +79,6 @@ screen_lyrics_clear(void) assert(current.loader == NULL || lyrics_result(current.loader) == LYRICS_SUCCESS); - current.song = NULL; - for (i = 0; i < current.lines->len; ++i) g_free(g_ptr_array_index(current.lines, i)); @@ -162,6 +160,8 @@ screen_lyrics_load(struct mpd_song *song) screen_lyrics_abort(); screen_lyrics_clear(); + current.song = song; + strfsong(buffer, sizeof(buffer), "%artist%", song); current.artist = g_strdup(buffer);