branch: externals/listen
commit addae17d8b24df4212aa7b57c4c402f85b54e013
Author: Adam Porter <[email protected]>
Commit: Adam Porter <[email protected]>

    Change: Use originalyear/originaldate in preference to date field
---
 README.org        | 1 +
 listen-library.el | 6 ++++--
 listen-queue.el   | 5 ++++-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/README.org b/README.org
index f34b5a32c7..bd8cb46386 100644
--- a/README.org
+++ b/README.org
@@ -80,6 +80,7 @@ Use the command ~listen~ to show the Transient menu.  From 
there, it is--hopeful
 
 *Changes*
 + All metadata in MP3 and Ogg files is available for display (not only 
standard tags).
++ For date field in library and queue views, show ~originalyear~ or 
~originaldate~ metadata fields in preference to ~date~ (which seems generally 
more useful, as the ~date~ field may contain a full date, and sometimes of a 
later release).
 
 *Fixes*
 + Increase timeout for reading track durations.
diff --git a/listen-library.el b/listen-library.el
index a2142bb617..ee143038b7 100644
--- a/listen-library.el
+++ b/listen-library.el
@@ -49,14 +49,16 @@
               (genre (track)
                 (or (listen-track-genre track) "[unknown genre]"))
               (date (track)
-                (or (listen-track-date track) "[unknown date]"))
+                (or (map-elt (listen-track-etc track) "originalyear")
+                    (map-elt (listen-track-etc track) "originaldate")
+                    (listen-track-date track)))
               (artist (track)
                 (or (with-face 'listen-artist (listen-track-artist track))
                     "[unknown artist]"))
               (album (track)
                 (or (when-let ((album (with-face 'listen-album 
(listen-track-album track))))
                       (concat album
-                              (pcase (listen-track-date track)
+                              (pcase (date track)
                                 (`nil nil)
                                 (date (format " (%s)" date)))))
                     "[unknown album]"))
diff --git a/listen-queue.el b/listen-queue.el
index c367f01563..0dd09bcb9e 100644
--- a/listen-queue.el
+++ b/listen-queue.el
@@ -149,7 +149,10 @@ intended to be set from the `listen-menu'."
                                    (or (listen-track-number track) "")))
                    (list :name "Date"
                          :getter (lambda (track _table)
-                                   (or (listen-track-date track) "")))
+                                   (or (map-elt (listen-track-etc track) 
"originalyear")
+                                       (map-elt (listen-track-etc track) 
"originaldate")
+                                       (listen-track-date track)
+                                       "")))
                    (list :name "Genre"
                          :getter (lambda (track _table)
                                    (propertize (or (listen-track-genre track) 
"")

Reply via email to