[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/listen a7da346ac1 10/15: Add: (listen-lighter-format-ra
From: |
ELPA Syncer |
Subject: |
[elpa] externals/listen a7da346ac1 10/15: Add: (listen-lighter-format-rating) |
Date: |
Tue, 5 Mar 2024 21:58:14 -0500 (EST) |
branch: externals/listen
commit a7da346ac1d8009bcd62bfe25256c839c18e1911
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>
Add: (listen-lighter-format-rating)
---
listen.el | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/listen.el b/listen.el
index c40c2c70c2..c2ccfe774e 100755
--- a/listen.el
+++ b/listen.el
@@ -96,6 +96,7 @@ For the currently playing track."
Each is called without arguments and should return a string
without extra whitespace."
:type '(repeat (choice (const :tag "Remaining queue time"
listen-queue-format-remaining)
+ (const :tag "Track rating"
listen-lighter-format-rating)
function)))
(defcustom listen-track-end-functions '(listen-play-next)
@@ -250,6 +251,15 @@ Interactively, jump to current queue's current track."
" ")
'("■ ")))))
+(defun listen-lighter-format-rating ()
+ "Return the rating of the current track for display in the lighter."
+ (when-let ((player (listen--player))
+ (queue (map-elt (listen-player-etc player) :queue))
+ (track (listen-queue-current queue))
+ (rating (or (listen-track-rating track)
+ (map-elt (listen-track-etc track) "fmps_rating"))))
+ (format "[%s]" (* 5 (string-to-number rating)))))
+
(declare-function listen-queue-play "listen-queue")
(declare-function listen-queue-next-track "listen-queue")
(defun listen-mode--update (&rest _ignore)
- [elpa] externals/listen updated (617225474f -> 903990570a), ELPA Syncer, 2024/03/05
- [elpa] externals/listen 202a708f52 02/15: Add: (listen-library-view-track) Bound to "m" in library buffer, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 51413ae251 07/15: Tidy, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 4aeef331a6 08/15: Fix: (listen-queue) Go to current track, ELPA Syncer, 2024/03/05
- [elpa] externals/listen addae17d8b 01/15: Change: Use originalyear/originaldate in preference to date field, ELPA Syncer, 2024/03/05
- [elpa] externals/listen a7da346ac1 10/15: Add: (listen-lighter-format-rating),
ELPA Syncer <=
- [elpa] externals/listen 99fdff93ea 12/15: Tidy: Rename listen--player to listen-current-player, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 903990570a 15/15: Release: v0.5, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 01d4c850c9 03/15: Meta: Add .dir-locals.el, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 9117c39318 05/15: Fix: (listen-queue) Mark current track by comparing filenames, ELPA Syncer, 2024/03/05
- [elpa] externals/listen c71ac57e54 06/15: Tidy: "Reload" rather than "refresh" tracks, ELPA Syncer, 2024/03/05
- [elpa] externals/listen cfaa1832f4 04/15: Change: (listen-queue) Right-align track numbers, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 5e3ee61bf3 09/15: Fix: (listen-queue-track-revert) Include etc metadata, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 278c97695a 11/15: Change: (listen-queue) Update current track when changed, ELPA Syncer, 2024/03/05
- [elpa] externals/listen ab4d75829a 13/15: Docs: Add screenshot, ELPA Syncer, 2024/03/05
- [elpa] externals/listen 64a23bfe69 14/15: Meta: Add .elpaignore, ELPA Syncer, 2024/03/05