Commit e28c0811 authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

careless access to track.image would cause exception in the Tidal plugin

parent 43dc9e47
...@@ -117,8 +117,9 @@ def trackentries(httphp, pathprefix, objid, tracks): ...@@ -117,8 +117,9 @@ def trackentries(httphp, pathprefix, objid, tracks):
posixpath.join(pathprefix, posixpath.join(pathprefix,
'track?version=1&trackId=%s' % track.id) 'track?version=1&trackId=%s' % track.id)
li['tp'] = 'it' li['tp'] = 'it'
if track.image: image = getattr(track, 'image', None)
li['upnp:albumArtURI'] = track.image if image:
li['upnp:albumArtURI'] = image
if track.album: if track.album:
li['upnp:album'] = track.album.name li['upnp:album'] = track.album.name
if not track.image and track.album.image: if not track.image and track.album.image:
......
...@@ -48,6 +48,7 @@ class Album(Model): ...@@ -48,6 +48,7 @@ class Album(Model):
num_tracks = -1 num_tracks = -1
duration = -1 duration = -1
release_date = None release_date = None
image = None
@property @property
def image(self, width=512, height=512): def image(self, width=512, height=512):
...@@ -89,6 +90,7 @@ class Track(Model): ...@@ -89,6 +90,7 @@ class Track(Model):
artists = [] artists = []
album = None album = None
available = True available = True
image = None
class SearchResult(Model): class SearchResult(Model):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment