summaryrefslogtreecommitdiff
path: root/nephilim/song.py
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2010-02-10 20:36:55 +0100
committerAnton Khirnov <wyskas@gmail.com>2010-02-11 08:36:42 +0100
commita3d29f073d721c4a34ea7f702a84eb1f4d639a6d (patch)
tree60173217fae12b210c50171ec31bbbc30a77aabe /nephilim/song.py
parente9f2b1ad2f951d72e1b0396bc9a74ed14b61acc3 (diff)
mpclient: add playlistid() func
also fix PlaylistEntryRef
Diffstat (limited to 'nephilim/song.py')
-rw-r--r--nephilim/song.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/nephilim/song.py b/nephilim/song.py
index 454b53d..607d4a6 100644
--- a/nephilim/song.py
+++ b/nephilim/song.py
@@ -105,21 +105,21 @@ 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. """
- id = None
+ plid = None
mpclient = None
- def __init__(self, mpclient, id):
+ def __init__(self, mpclient, plid):
self.mpclient = mpclient
- self.id = id
+ self.plid = plid
def __getitem__(self, key):
- return self.id if key == 'id' else self.song()[key]
+ return self.plid if key == 'id' else self.song()[key]
def __nonzero__(self):
- return self.id != '-1'
+ return self.plid != '-1'
def song(self):
try:
- return Song(self.mpclient.playlistid(id)[0])
+ return self.mpclient.playlistid(self.plid)
except IndexError:
return Song({})