[gnome-music/wip/jfelder/musicbrainz-tageditordialog: 4/6] utils: Handle more tags
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/musicbrainz-tageditordialog: 4/6] utils: Handle more tags
- Date: Mon, 22 Oct 2018 13:37:58 +0000 (UTC)
commit b7f39acf911bdaf432c708868dce469dfbd2bb48
Author: Jean Felder <jfelder src gnome org>
Date: Tue Aug 21 00:24:40 2018 +0200
utils: Handle more tags
gnomemusic/utils.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
---
diff --git a/gnomemusic/utils.py b/gnomemusic/utils.py
index ec171663..c54d1f48 100644
--- a/gnomemusic/utils.py
+++ b/gnomemusic/utils.py
@@ -56,6 +56,19 @@ def get_album_title(item):
return album
+def get_album_disc_nr(item):
+ """Returns the album song number associated with the media item
+
+ :param Grl.Media item: song
+ :return: The album title
+ :rtype: string
+ """
+ track_number = item.get_album_disc_number()
+ if track_number == 0:
+ track_number = ""
+ return str(track_number)
+
+
def get_artist_name(item):
"""Returns the preferred artist for a media item.
@@ -75,6 +88,43 @@ def get_artist_name(item):
or _("Unknown Artist"))
+def get_composer_name(item):
+ """Returns the composer for a media item.
+
+ :param Grl.Media item: song
+ :return: The artist name
+ :rtype: string
+ """
+
+ return (item.get_composer()
+ or None)
+
+
+def get_media_genre(item):
+ """Returns the title of the media item.
+
+ :param item: A Grilo Media object
+ :return: The title
+ :rtype:
+ """
+
+ return (item.get_genre()
+ or None)
+
+
+def get_media_track_nr(item):
+ """Returns the title of the media item.
+
+ :param item: A Grilo Media object
+ :return: The title
+ :rtype:
+ """
+ track_number = item.get_track_number()
+ if track_number == 0:
+ return ""
+ return str(track_number)
+
+
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]