From 8901b6955f1c74436c2033b4a8ac43f01a067682 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 25 Apr 2013 07:59:00 +0200 Subject: song: drop PlaylistEntryRef It adds a lot of complexity for little real benefit. --- nephilim/song.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'nephilim/song.py') diff --git a/nephilim/song.py b/nephilim/song.py index eb5fedb..709934a 100644 --- a/nephilim/song.py +++ b/nephilim/song.py @@ -26,7 +26,7 @@ class Song(dict): Song provides a dictionary-like wrapper around song metadata. Its instances are generated by MPClient, don't instantiate it directly. - Its instances _shouldn't_ be stored, use SongRef or PlaylistEntryRef for that. + Its instances _shouldn't_ be stored, use SongRef for that. Access '?tag' to get always at least an empty string. """ @@ -109,23 +109,3 @@ class SongRef: def song(self): return list(self.mpclient.find_sync('file', self.path))[0] - -class PlaylistEntryRef: - """This class stores a reference to a playlist entry instead of full - metadata to conserve memory. Song's tags can be accessed - as in Song, but it requires a call to MPD for each tag. """ - plid = None - mpclient = None - - def __init__(self, mpclient, plid): - self.mpclient = mpclient - self.plid = plid - - def __getitem__(self, key): - return self.plid if key == 'id' else self.song()[key] - - def __nonzero__(self): - return self.plid != '-1' - - def song(self): - return self.mpclient.get_plist_song(self.plid) -- cgit v1.2.3