[gnome-music/wip/mschraal/tageditor-13feb2020: 34/53] 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-13feb2020: 34/53] utils: Add fields to getters mapping
- Date: Wed, 26 Feb 2020 15:14:25 +0000 (UTC)
commit ec1aabd745b9481252bfa03b776afa5e2081acad
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 fe2798e6..a8aef985 100644
--- a/gnomemusic/utils.py
+++ b/gnomemusic/utils.py
@@ -210,3 +210,13 @@ def natural_sort_names(name_a, name_b):
for tmp in re.split(r"(\d+)", normalize_caseless(text))]
return _extract_numbers(name_b) < _extract_numbers(name_a)
+
+
+fields_getter = {
+ "album": get_album_title,
+ "artist": get_song_artist,
+ "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]