From c64c37477b87ec545365b8923d6f9ff745469617 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonathan=20Neusch=C3=A4fer?= Date: Sat, 17 Dec 2011 15:54:47 +0100 Subject: [PATCH] screen_lyrics: put code for reloading in a function --- src/screen_lyrics.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 6de59d5..a8c7210 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -246,6 +246,17 @@ screen_lyrics_load(const struct mpd_song *song) } } +static void +screen_lyrics_reload(void) +{ + if (current.loader == NULL && current.artist != NULL && + current.title != NULL) { + current.loader = lyrics_load(current.artist, current.title, + screen_lyrics_callback, NULL); + screen_text_repaint(&text); + } +} + static void lyrics_screen_init(WINDOW *w, int cols, int rows) { @@ -369,12 +380,7 @@ lyrics_cmd(struct mpdclient *c, command_t cmd) } return true; case CMD_SELECT: - if (current.loader == NULL && current.artist != NULL && - current.title != NULL) { - current.loader = lyrics_load(current.artist, current.title, - screen_lyrics_callback, NULL); - screen_text_repaint(&text); - } + screen_lyrics_reload(); return true; #ifdef ENABLE_SONG_SCREEN -- 2.30.2