[gnome-music] playlists: Cleanup for Tracker port
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] playlists: Cleanup for Tracker port
- Date: Thu, 5 Jun 2014 09:09:49 +0000 (UTC)
commit 9d093acb2b6748490e20128b7db9a0da8085d8d5
Author: Arnel Borja <arnelborja src gnome org>
Date: Wed Jun 4 01:25:44 2014 +0800
playlists: Cleanup for Tracker port
gnomemusic/playlists.py | 40 +---------------------------------------
gnomemusic/view.py | 1 -
2 files changed, 1 insertions(+), 40 deletions(-)
---
diff --git a/gnomemusic/playlists.py b/gnomemusic/playlists.py
index b77f2b5..9ec75dc 100644
--- a/gnomemusic/playlists.py
+++ b/gnomemusic/playlists.py
@@ -1,10 +1,8 @@
-from gi.repository import TotemPlParser, Grl, GLib, Gio, GObject
+from gi.repository import Grl, GLib, GObject
from gi.repository import Tracker
from gnomemusic.grilo import grilo
from gnomemusic.query import Query
-import os
-
from gnomemusic import log
import logging
logger = logging.getLogger(__name__)
@@ -41,9 +39,6 @@ class Playlists(GObject.GObject):
@log
def __init__(self):
GObject.GObject.__init__(self)
- self.playlist_dir = os.path.join(GLib.get_user_data_dir(),
- 'gnome-music',
- 'playlists')
@log
def create_playlist(self, name):
@@ -82,18 +77,6 @@ class Playlists(GObject.GObject):
)
@log
- def get_playlists(self):
- playlist_files = [pl_file for pl_file in os.listdir(self.playlist_dir)
- if os.path.isfile(os.path.join(self.playlist_dir,
- pl_file))]
- playlist_names = []
- for playlist_file in playlist_files:
- name, ext = os.path.splitext(playlist_file)
- if ext == '.pls':
- playlist_names.append(name)
- return playlist_names
-
- @log
def add_to_playlist(self, playlist, items):
def get_callback(source, param, item, count, data, error):
if item:
@@ -139,24 +122,3 @@ class Playlists(GObject.GObject):
GLib.PRIORITY_DEFAULT,
None, update_callback, item
)
-
- @log
- def get_path_to_playlist(self, playlist_name):
- return os.path.join(self.playlist_dir, "%s.pls" % playlist_name)
-
- @log
- def parse_playlist(self, playlist_name, callback):
- parser = TotemPlParser.Parser()
- parser.connect('entry-parsed', self._on_entry_parsed, callback)
- parser.parse_async(
- GLib.filename_to_uri(self.get_path_to_playlist(playlist_name), None),
- False, None, None, None
- )
-
- @log
- def _on_entry_parsed(self, parser, uri, metadata, data=None):
- filename = GLib.filename_from_uri(uri)[0]
- if filename and not os.path.isfile(filename):
- return
-
- grilo.get_media_from_uri(uri, data)
diff --git a/gnomemusic/view.py b/gnomemusic/view.py
index fc8f73c..d428022 100644
--- a/gnomemusic/view.py
+++ b/gnomemusic/view.py
@@ -789,7 +789,6 @@ class Artists (ViewContainer):
class Playlist(ViewContainer):
- playlists_list = playlists.get_playlists()
@log
def __init__(self, window, player):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]