From 0bc4b4ea73464e175012c89251d685a5992efaf1 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 25 Apr 2013 07:59:58 +0200 Subject: song: drop SongRef It adds a lot of complexity for little real benefit. --- nephilim/song.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/nephilim/song.py b/nephilim/song.py index 709934a..d68b21c 100644 --- a/nephilim/song.py +++ b/nephilim/song.py @@ -26,7 +26,6 @@ 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 for that. Access '?tag' to get always at least an empty string. """ @@ -89,23 +88,3 @@ class Song(dict): ret = Template(s) ret = ret.safe_substitute(self) return ret - -class SongRef: - """SongRef stores only a reference to the song (uri) 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. """ - path = None - mpclient = None - - def __init__(self, mpclient, path): - self.mpclient = mpclient - self.path = path - - def __getitem__(self, key): - return self.song()[key] - - def __nonzero__(self): - return bool(self.path) - - def song(self): - return list(self.mpclient.find_sync('file', self.path))[0] -- cgit v1.2.3