[gnome-music/freeze-break: 89/107] playlists: Implement delete_playlist



commit dc8ecfa8b682b8043383af8b6e3837bead448926
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Sun Sep 8 19:31:13 2013 +0800

    playlists: Implement delete_playlist

 gnomemusic/playlists.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/playlists.py b/gnomemusic/playlists.py
index 8bacd9d..4e810f7 100644
--- a/gnomemusic/playlists.py
+++ b/gnomemusic/playlists.py
@@ -53,7 +53,9 @@ class Playlists:
         parser.save(playlist, pl_file, playlist_name, TotemPlParser.ParserType.PLS)
 
     def delete_playlist(self, playlist_name):
-        pass
+        playlist_file = self.get_path_to_playlist(playlist_name)
+        if os.path.isfile(playlist_file):
+            os.remove(playlist_file)
 
     def get_path_to_playlist(self, playlist_name):
         return os.path.join(self.playlist_dir, playlist_name + ".pls")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]