Skip to content
Snippets Groups Projects
Commit 975d0081 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

MusicTrackListener: Fix pylint errors

parent 390bae9d
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,13 @@ ...@@ -32,6 +32,13 @@
class MusicTrackInfo: class MusicTrackInfo:
__slots__ = ['title', 'album', 'artist', 'duration', 'track_number', __slots__ = ['title', 'album', 'artist', 'duration', 'track_number',
'paused'] 'paused']
def __init__(self):
self.title = None
self.album = None
self.artist = None
self.duration = None
self.track_number = None
self.paused = None
class MusicTrackListener(GObject.GObject): class MusicTrackListener(GObject.GObject):
...@@ -167,11 +174,7 @@ def _properties_extract(properties): ...@@ -167,11 +174,7 @@ def _properties_extract(properties):
info = MusicTrackInfo() info = MusicTrackInfo()
info.title = meta.get('xesam:title') info.title = meta.get('xesam:title')
info.album = meta.get('xesam:album') info.album = meta.get('xesam:album')
artist = meta.get('xesam:artist') info.artist = meta.get('xesam:artist')
if artist:
info.artist = artist[0]
else:
info.artist = None
info.duration = float(meta.get('mpris:length', 0)) info.duration = float(meta.get('mpris:length', 0))
info.track_number = meta.get('xesam:trackNumber', 0) info.track_number = meta.get('xesam:trackNumber', 0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment