From e61081294d74aa85924910e37701b72fed9bb8ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonathan=20Neusch=C3=A4fer?= Date: Sat, 3 Apr 2010 21:35:36 +0200 Subject: [PATCH] Make delete_lyr_hd usable --- src/screen_help.c | 1 + src/screen_lyrics.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/screen_help.c b/src/screen_help.c index e5dfaae..2ac90b7 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -161,6 +161,7 @@ static const struct help_text_row help_text[] = { { 0, CMD_INTERRUPT, N_("Interrupt retrieval") }, { 0, CMD_LYRICS_UPDATE, N_("Download lyrics for currently playing song") }, { 0, CMD_SAVE_PLAYLIST, N_("Save lyrics") }, + { 0, CMD_DELETE, N_("Delete saved lyrics") }, #endif #ifdef ENABLE_OUTPUTS_SCREEN { 0, CMD_NONE, NULL }, diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 173fc5a..4d1122b 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -302,6 +302,26 @@ lyrics_cmd(struct mpdclient *c, command_t cmd) /* lyrics for the song were saved on hard disk */ screen_status_message (_("Lyrics saved")); return true; + case CMD_DELETE: + { + int success; + + if (current.loader == NULL && current.artist != NULL && + current.title != NULL) { + success = delete_lyr_hd(); + switch (success) { + case 0: + screen_status_message + (_("Lyrics deleted")); + break; + case -1: + screen_status_message + (_("No saved lyrics")); + break; + } + } + return true; + } case CMD_LYRICS_UPDATE: if (c->song != NULL) { screen_lyrics_load(c->song); -- 2.30.2