From ee599b6235aff2572604580e5ea0c57438571e29 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Sun, 9 Sep 2012 23:57:06 +0200 Subject: [PATCH] Add changelog entry for #72 and remove old comments. --- docs/changes.rst | 3 +++ mopidy/backends/spotify/library.py | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/changes.rst b/docs/changes.rst index 5722430088..082ad136d9 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -68,6 +68,9 @@ v0.8 (in development) cleanup code would wait for an response that would never come inside the event loop, blocking everything else. +- Created a Spotify track proxy that will switch to using loaded data as soon + as it becomes available. Fixes :issue:`72`. + v0.7.3 (2012-08-11) =================== diff --git a/mopidy/backends/spotify/library.py b/mopidy/backends/spotify/library.py index 181dc19d6c..18276ecdb8 100644 --- a/mopidy/backends/spotify/library.py +++ b/mopidy/backends/spotify/library.py @@ -11,6 +11,7 @@ class SpotifyTrack(Track): + """Proxy object for unloaded Spotify tracks.""" def __init__(self, uri): self._spotify_track = Link.from_string(uri).as_track() self._unloaded_track = Track(uri=uri, name=u'[loading...]') @@ -34,15 +35,15 @@ def __getattribute__(self, name): def __repr__(self): return self._proxy.__repr__() - def __hash__(self): # hash on just uri for consistency? + def __hash__(self): return hash(self._proxy.uri) - def __eq__(self, other): # compare on just uri for consistency? + def __eq__(self, other): if not isinstance(other, Track): return False return self._proxy.uri == other.uri - def copy(self, **values): # is it okay to return a plain track? + def copy(self, **values): return self._proxy.copy(**values)