Code

Make delete_lyr_hd usable
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Sat, 3 Apr 2010 19:35:36 +0000 (21:35 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 5 Apr 2010 17:05:00 +0000 (19:05 +0200)
src/screen_help.c
src/screen_lyrics.c

index e5dfaae3638ba417d6a1c8e687dbc5aaed62e5c0..2ac90b774c30bcc125af11eb4a5e02e274b60ed2 100644 (file)
@@ -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 },
index 173fc5a2814c4832d2189fc097dd4c7c1cda1e49..4d1122b4b290e64ee9a73b6e22ab4a543a6adb28 100644 (file)
@@ -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);