[gnome-music/songeditor-tracker3: 25/32] utils: Add a getter for album artist
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/songeditor-tracker3: 25/32] utils: Add a getter for album artist
- Date: Mon, 25 May 2020 18:34:27 +0000 (UTC)
commit ab685c47870ac873fd4ca5fab4edfc0698109cad
Author: Jean Felder <jfelder src gnome org>
Date: Mon May 18 18:26:23 2020 +0200
utils: Add a getter for album artist
Unlike `get_artist_name`, it does not take into account, the artist of
the song.
gnomemusic/utils.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/gnomemusic/utils.py b/gnomemusic/utils.py
index 65b68718..84895363 100644
--- a/gnomemusic/utils.py
+++ b/gnomemusic/utils.py
@@ -100,6 +100,20 @@ def get_song_artist(item):
or "")
+def get_album_artist(item):
+ """Returns the album artist of a song.
+
+ Unlike `get_artist_name`, it does not fallback to the artist of
+ the song if the album artist is not set.
+
+ :param Grl.Media item: A Grilo Media object
+ :return: The song artist name
+ :rtype: string
+ """
+ return (item.get_album_artist()
+ or "")
+
+
def get_media_title(item):
"""Returns the title of the media item.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]