The following patch does the trick. Since I am not a lisp programmer, it
is maybe not very elegant, but you'll get the idea.
Best,
On 11/26/25 01:21, Erica Qi wrote:
Yes of course.
I responded this morning but I must have been on the wrong email account.
I'll take a look.
Erica.
Sent from Proton Mail for Android.
-------- Original Message --------
On Tuesday, 11/25/25 at 13:14 Yoni Rabkin <[email protected]> wrote:
Igor Sosa Mayor <[email protected]> writes:
Hi emms-users,
I have already a small problem. In this case with the filter factory
defined as "Not played since". If I filter my tracks with "Played
since" and "Not played since" 30 days, I get exactly the same
results... Either it is a problem with the way my tracks are storing
the time or a problem with the code.
More precisely my question is: is this code working at expected?
(defun emms-filters-make-filter-not-played-within (days)
"Make a not played since DAYS filter."
(lambda (track)
(funcall (emms-filters-make-filter-played-within days) track)))
Thanks in advance!
Erica, can you please have a look into this when you have time?
--
"Cut your own wood and it will warm you twice"
From 05e0678a725cdc237eef3edb0bcacbbd9bf618c5 Mon Sep 17 00:00:00 2001
From: Igor Sosa Mayor <[email protected]>
Date: Wed, 26 Nov 2025 08:12:57 +0100
Subject: [PATCH] Not played since.
---
emms-filters.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/emms-filters.el b/emms-filters.el
index 12485af..0d1abd2 100644
--- a/emms-filters.el
+++ b/emms-filters.el
@@ -860,7 +860,7 @@ Uses a regex anchoring dirname to the beginning of the expanded path."
'(("Directory: " (:string . nil))))
;; seconds in a day (* 60 60 24) = 86400
-(defun emms-filters-make-filter-played-within (days)
+(defun emms-filters-make-filter-played-within-or-not-within (days &optional not-within)
"Show only tracks played within the last number of DAYS."
(let ((seconds-to-time (seconds-to-time (* days 86400))))
#'(lambda (track)
@@ -870,16 +870,18 @@ Uses a regex anchoring dirname to the beginning of the expanded path."
last-played)
(and (setq last-played
(emms-track-get track 'last-played nil))
- (time-less-p min-date last-played))))))
+ (if not-within
+ (time-less-p last-played min-date)
+ (time-less-p min-date last-played)))))))
(emms-filters-register-filter-factory "Played since"
- 'emms-filters-make-filter-played-within
+ 'emms-filters-make-filter-played-within-or-notwithihin
'(("Days: " (:number . nil))))
(defun emms-filters-make-filter-not-played-within (days)
"Make a not played since DAYS filter."
(lambda (track)
- (funcall (emms-filters-make-filter-played-within days) track)))
+ (funcall (emms-filters-make-filter-played-within-or-notwithihin days t) track)))
(emms-filters-register-filter-factory "Not played since"
'emms-filters-make-filter-not-played-within
--
2.52.0