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



commit efc3124c882a55ccbbe57566e71b5de2d8dd940f
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 c54d1f48..504878fe 100644
--- a/gnomemusic/utils.py
+++ b/gnomemusic/utils.py
@@ -164,3 +164,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]