[gnome-music/freeze-break: 66/107] playlists: Add new method for getting path to a playlist



commit 3e977fca38d46d6e5bdc354138e5c29f56482e63
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Wed Sep 4 22:19:11 2013 +0800

    playlists: Add new method for getting path to a playlist

 gnomemusic/playlists.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/playlists.py b/gnomemusic/playlists.py
index cf2bea7..e471c38 100644
--- a/gnomemusic/playlists.py
+++ b/gnomemusic/playlists.py
@@ -22,7 +22,7 @@ class Playlists:
     def create_playlist(self, name, iterlist=None):
         parser = TotemPlParser.Parser()
         playlist = TotemPlParser.Playlist()
-        pl_file = Gio.file_new_for_path(self.playlist_dir + name + ".pls")
+        pl_file = Gio.file_new_for_path(self.get_path_to_playlist(name))
         if iterlist is not None:
             for _iter in iterlist:
                 pass
@@ -47,3 +47,6 @@ class Playlists:
 
     def delete_playlist(self, playlist_name):
         pass
+
+    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]