Artwork

Note

It is anticipated that the artwork information will be retrieved via the LMSPlayer object.

class LMSTools.artworkresolver.LMSArtworkResolver(host='localhost', port=9000)

Class object to help provide an easy way of obtaining a URL to a playlist item.

The class is capable of working out the appropriate path depending on whether the file is remote or local.

Parameters:
  • host (str) – address of the server
  • port (int) – webport of the server (default 9000)

The class is used by LMSPlayer to provide artwork urls but can be used independently with calls being made to the getURL method.

classmethod from_server(server)

Create an instance using a LMSServer object.

Parameters:server (LMSServer) – Instance of LMSServer
getURL(track, size=(500, 500))

Method for generating link to artwork for the selected track.

Parameters:
  • track (dict) – a dict object which must contain the “remote”, “coverid” and “coverart” tags as returned by the server.
  • size (tuple) – optional parameter which can be used when creating links for local images. Default (500, 500).
is_default(url)

Check whether a specified url is the default (i.e. fallback) image address.

Parameters:url (str) – image url
Return type:bool
Returns:True if image is default