[gnome-music/wip/mschraal/core: 32/92] coresong: Add some more props and cleanup



commit e67d516567ef44156ff8fd774dd07a31840603f1
Author: Marinus Schraal <mschraal gnome org>
Date:   Wed May 8 16:47:27 2019 +0200

    coresong: Add some more props and cleanup

 gnomemusic/coresong.py | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/coresong.py b/gnomemusic/coresong.py
index 244a93e4..2a2f637d 100644
--- a/gnomemusic/coresong.py
+++ b/gnomemusic/coresong.py
@@ -2,19 +2,33 @@ import gi
 gi.require_version('Grl', '0.3')
 from gi.repository import Grl, GObject
 
+from gnomemusic import log
 import gnomemusic.utils as utils
 
+
 class CoreSong(GObject.GObject):
     """Exposes a Grl.Media with relevant data as properties
     """
 
-    url = GObject.Property(type=str)
+    album = GObject.Property(type=str)
+    album_disc_number = GObject.Property(type=int)
+    artist = GObject.Property(type=str)
+    duration = GObject.Property(type=int)
+    favorite = GObject.Property(type=int)
+    play_count = GObject.Property(type=int)
+    position = GObject.Property(type=int)
     title = GObject.Property(type=str)
+    url = GObject.Property(type=str)
 
+    @log
     def __init__(self, media):
         super().__init__()
 
         self._media = media
 
-        self.props.url = self._media.get_url()
+        self.props.album = utils.get_album_title(media)
+        self.props.artist = utils.get_artist_name(media)
+        self.props.play_count = self._media.get_play_count()
         self.props.title = utils.get_media_title(self._media)
+        self.props.url = self._media.get_url()
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]