[gnome-music/wip/mschraal/tageditor-13feb2020: 33/53] utils: Add a getter for song artist
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/tageditor-13feb2020: 33/53] utils: Add a getter for song artist
- Date: Wed, 26 Feb 2020 15:14:20 +0000 (UTC)
commit 4b33e5db34514b6ed10c2e23f3f11f78c7cc2702
Author: Jean Felder <jfelder src gnome org>
Date: Fri Jan 24 03:19:39 2020 +0100
utils: Add a getter for song artist
Unlike `get_artist_name`, it does not take into account, the main
artist of the full album (album artist).
gnomemusic/utils.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/gnomemusic/utils.py b/gnomemusic/utils.py
index f57eb139..fe2798e6 100644
--- a/gnomemusic/utils.py
+++ b/gnomemusic/utils.py
@@ -85,6 +85,20 @@ def get_artist_name(item):
or _("Unknown Artist"))
+def get_song_artist(item):
+ """Returns the artist of a song.
+
+ Unlike `get_artist_name`, it does not take into account
+ the main artist of the full album (album artist).
+
+ :param Grl.Media item: A Grilo Media object
+ :return: The song artist name
+ :rtype: string
+ """
+ return (item.get_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]