[gnome-music/wip/jfelder/corealbum-url] corealbum: Add an url property
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/corealbum-url] corealbum: Add an url property
- Date: Sat, 31 Aug 2019 11:09:10 +0000 (UTC)
commit c77bc2c80034250a29131112eec3598e274d08e7
Author: Jean Felder <jfelder src gnome org>
Date: Sat Aug 31 14:05:37 2019 +0300
corealbum: Add an url property
The url GObject is mandatory to be able to get the embedded art from a
file of an album.
Closes: #307
gnomemusic/corealbum.py | 2 ++
gnomemusic/grilowrappers/grltrackerwrapper.py | 2 ++
2 files changed, 4 insertions(+)
---
diff --git a/gnomemusic/corealbum.py b/gnomemusic/corealbum.py
index f1834915..30455742 100644
--- a/gnomemusic/corealbum.py
+++ b/gnomemusic/corealbum.py
@@ -38,6 +38,7 @@ class CoreAlbum(GObject.GObject):
duration = GObject.Property(type=int, default=0)
media = GObject.Property(type=Grl.Media)
title = GObject.Property(type=str)
+ url = GObject.Property(type=str)
year = GObject.Property(type=str, default="----")
def __repr__(self):
@@ -65,6 +66,7 @@ class CoreAlbum(GObject.GObject):
self.props.artist = utils.get_artist_name(media)
self.props.composer = media.get_composer()
self.props.title = utils.get_media_title(media)
+ self.props.url = media.get_url()
self.props.year = utils.get_media_year(media)
@GObject.Property(
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index 97953c81..a4d25dfb 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -180,6 +180,7 @@ class GrlTrackerWrapper(GObject.GObject):
?composer AS ?composer
?album_artist AS ?album_artist
nmm:artistName(?performer) AS ?artist
+ nie:url(?song) AS ?url
YEAR(MAX(nie:contentCreated(?song))) AS ?creation_date
WHERE {
?album a nmm:MusicAlbum .
@@ -416,6 +417,7 @@ class GrlTrackerWrapper(GObject.GObject):
?composer AS ?composer
?album_artist AS ?album_artist
nmm:artistName(?performer) AS ?artist
+ nie:url(?song) AS ?url
YEAR(MAX(nie:contentCreated(?song))) AS ?creation_date
WHERE
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]