Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
upmpdcli
Commits
e28c0811
Commit
e28c0811
authored
Jun 12, 2020
by
Jean-Francois Dockes
Browse files
careless access to track.image would cause exception in the Tidal plugin
parent
43dc9e47
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/mediaserver/cdplugins/pycommon/upmplgutils.py
View file @
e28c0811
...
@@ -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
:
...
...
src/mediaserver/cdplugins/tidal/tidalapi/models.py
View file @
e28c0811
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment