From: Jonathan Neuschäfer Date: Sat, 3 Apr 2010 19:35:36 +0000 (+0200) Subject: Make delete_lyr_hd usable X-Git-Tag: release-0.17~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e61081294d74aa85924910e37701b72fed9bb8ae;p=ncmpc.git Make delete_lyr_hd usable --- 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);