[gnome-music/wip/mschraal/tageditor: 5/21] utils: Add fields to getters mapping
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/tageditor: 5/21] utils: Add fields to getters mapping
- Date: Fri, 22 Nov 2019 15:56:33 +0000 (UTC)
commit 05b85b5f435c5b35031ef7e53e2f440d6ee1dbc0
Author: Sumaid Syed <sumaidsyed gmail com>
Date: Fri Aug 16 16:09:49 2019 +0530
utils: Add fields to getters mapping
Add a dictionary which allows iterating over
different getters and filling corresponding entries
or suggestions in tageditor.
gnomemusic/utils.py | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gnomemusic/utils.py b/gnomemusic/utils.py
index c6a59ec8..4a8d28a4 100644
--- a/gnomemusic/utils.py
+++ b/gnomemusic/utils.py
@@ -160,3 +160,13 @@ def seconds_to_string(duration):
seconds %= 60
return '{:d}:{:02d}'.format(minutes, seconds)
+
+
+fields_getter = {
+ "album": get_album_title,
+ "artist": get_artist_name,
+ "disc": get_album_disc_nr,
+ "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]