[gnome-music/wip/jfelder/musicbrainz-tageditordialog: 30/31] utils: Map grilo tags and utils functions



commit 00d1ebada86f1983f9cd03c2f4656abffb170f65
Author: Jean Felder <jfelder src gnome org>
Date:   Mon Sep 3 08:11:02 2018 +0200

    utils: Map grilo tags and utils functions
    
    Add a dictionnary to map a tag name with the corresponding utils
    function to get it.

 gnomemusic/utils.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gnomemusic/utils.py b/gnomemusic/utils.py
index 56b7e350..7294dfdd 100644
--- a/gnomemusic/utils.py
+++ b/gnomemusic/utils.py
@@ -175,3 +175,15 @@ def seconds_to_string(duration):
     seconds %= 60
 
     return '{:d}:{:02d}'.format(minutes, seconds)
+
+
+fields = {
+    'album': get_album_title,
+    'artist': get_artist_name,
+    'composer': get_composer_name,
+    'disc': get_album_disc_nr,
+    'genre': get_media_genre,
+    'title': get_media_title,
+    'track': get_media_track_nr,
+    'year': get_media_year
+    }


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