Code

screen_lyrics: set current.song
authorMax Kellermann <max@duempel.org>
Tue, 23 Sep 2008 10:08:14 +0000 (12:08 +0200)
committerMax Kellermann <max@duempel.org>
Tue, 23 Sep 2008 10:08:14 +0000 (12:08 +0200)
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()).

src/screen_lyrics.c

index c2c7807235fd628c065ce186db429f250a2f5a11..cfc65893981ac9c119f2c93e88f09684ec17f5dc 100644 (file)
@@ -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);