summaryrefslogtreecommitdiff
path: root/nephilim/song.py
diff options
context:
space:
mode:
Diffstat (limited to 'nephilim/song.py')
-rw-r--r--nephilim/song.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/nephilim/song.py b/nephilim/song.py
index 0eef97b..0cf3b5c 100644
--- a/nephilim/song.py
+++ b/nephilim/song.py
@@ -108,16 +108,13 @@ class SongRef:
return bool(self.path)
def song(self):
- try:
- return Song(self.mpclient.find('file', self.path)[0])
- except IndexError:
- return Song({})
+ 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
+ plid = None
mpclient = None
def __init__(self, mpclient, plid):
@@ -131,7 +128,4 @@ class PlaylistEntryRef:
return self.plid != '-1'
def song(self):
- try:
- return self.mpclient.playlistid(self.plid)
- except IndexError:
- return Song({})
+ return self.mpclient.get_plist_song(self.plid)