Code

screen_lyrics.c: Add function delete_lyr_hd
[ncmpc.git] / src / screen_lyrics.c
index 6cb7b46efddf71590f40d010936a701f18b80d46..173fc5a2814c4832d2189fc097dd4c7c1cda1e49 100644 (file)
@@ -138,6 +138,21 @@ store_lyr_hd(void)
        return 0;
 }
 
+static int
+delete_lyr_hd(void)
+{
+       char path[1024];
+
+       if (!exists_lyr_file(current.artist, current.title))
+               return -1;
+
+       path_lyr_file(path, 1024, current.artist, current.title);
+       if (unlink(path) != 0)
+               return -2;
+
+       return 0;
+}
+
 static void
 screen_lyrics_set(const GString *str)
 {