commit 906e3938298d8ab91936cc7800fd7f0e8cfd7f52 from: mtmn date: Thu Aug 27 09:52:12 2026 UTC add daily filtering, reverse order commit - 7da8ef9eb7516961a7acaedbe448cde8a6e66380 commit + 906e3938298d8ab91936cc7800fd7f0e8cfd7f52 blob - dd5eb25c031c1b4f1578aa089476ced1fc81d51a blob + facdbe6734a9193f10c74f61f62ebae8fb2b0c59 --- README.md +++ README.md @@ -40,8 +40,9 @@ ninja tui INPUT=demo ## Keys ```text -m months w weeks l labels -a artists s search r random play +d dailies m months w weeks +l labels a artists s search +r random play p play release q queue release pa play buffer qa queue buffer nn next page pp prev page b back @@ -49,6 +50,10 @@ nn next page pp prev page b back x exit ``` +Chronological views show the newest entries first. The dailies view shows one +effective source per date after applying the daily, fallback, and session +precedence rules. Days, weeks, and months with no counted releases are omitted. + Enter a row number to open it. Commands such as `:month 2026-08`, `:day 2026-08-11`, `:label Warp`, `:artist Autechre`, `:release Label/Artist/Release`, and `:search Autechre` blob - 72778315b5c77ca53c9db9d0b0f203f3b95d0211 blob + b1b0d3dc2027753401c52f08c856ed8549983ffd --- doc/mcol.1 +++ doc/mcol.1 @@ -1,4 +1,4 @@ -.TH MCOL 1 "2026-08-23" "mcol" "User Commands" +.TH MCOL 1 "2026-08-26" "mcol" "User Commands" .SH NAME mcol \- browse an MPD release archive .SH SYNOPSIS @@ -60,11 +60,20 @@ Fail on malformed historical filenames. Print usage. .SH KEYS .TP +.B d +Show effective daily sources, newest first. There is one row per date after +applying the daily, fallback, and session precedence rules. +.TP .BR m , .BR w , .BR l , .B a Show months, weeks, labels, or artists. +.PP +Chronological views and addition-date lists are shown newest first. Releases +within a label or artist view are ordered by their latest known daily addition; +entries known only from weekly sources follow dated releases. +Days, weeks, and months with no counted release additions are omitted. .TP .B s Search artists, labels, releases, and paths. blob - 48c89f1ba7d2310515cb27fa3f798c06fe4257fd blob + 39864a15674a715bec0f17379fb8d6e7f5781c4b --- src/mcol/core.sls +++ src/mcol/core.sls @@ -254,6 +254,8 @@ (vector->list (hashtable-keys table))) (define (sorted-keys table) (sort string? (table-keys table))) (define (unique-entries entries) (let ([seen (make-string-table)]) (filter (lambda (item) @@ -348,7 +350,9 @@ (sources-of-kind database 'daily)) table)) (define (canonical-days canonical) - (map (lambda (date) (file-summary (hashtable-ref canonical date #f))) (sorted-keys canonical))) + (filter (lambda (day) (> (field day 'additions) 0)) + (map (lambda (date) (file-summary (hashtable-ref canonical date #f))) + (reverse-sorted-keys canonical)))) (define (dated-catalog canonical database) (append (fold-left (lambda (entries date) (append entries @@ -395,7 +399,7 @@ 'observedDays) (max 1 expected)))) 10.0)))))) - (sorted-keys table)))) + (reverse-sorted-keys table)))) (define (label-summary canonical) (let ([counts (make-string-table)]) (for-each @@ -420,23 +424,26 @@ (map (lambda (key) (object (cons 'name key) (cons 'count (hashtable-ref counts key 0)))) (table-keys counts))))) (define (weekly-summary database days) - (map (lambda (item) - (let* ([row (file-summary item)] - [daily-total (fold-left (lambda (sum day) - (if (and (string<=? (source-period-start item) - (field day - 'date)) - (string<=? (field day - 'date) - (source-period-end item))) - (+ sum - (field day - 'additions)) - sum)) - 0 - days)]) - (append row (object (cons 'dailyAdditions daily-total))))) - (sources-of-kind database 'weekly))) + (filter (lambda (week) (> (field week 'additions) 0)) + (sort (lambda (left right) + (string>? (field left 'periodStart) (field right 'periodStart))) + (map (lambda (item) + (let* ([row (file-summary item)] + [daily-total (fold-left (lambda (sum day) + (if (and (string<=? (source-period-start item) + (field day + 'date)) + (string<=? (field day + 'date) + (source-period-end item))) + (+ sum + (field day + 'additions)) + sum)) + 0 + days)]) + (append row (object (cons 'dailyAdditions daily-total))))) + (sources-of-kind database 'weekly))))) (define (summarize database) (let* ([canonical (canonical-sources database)] [days (canonical-days canonical)] blob - 9a40b996cbc13bbaaaee79c3852e729732b11e17 blob + 00d8a6fcb98ec3f6a3e827342da62bfc5bd52fcc --- src/mcol/tui.sls +++ src/mcol/tui.sls @@ -259,8 +259,29 @@ (define (dates-for path) (let ([dates (hashtable-ref dates-by-path path #f)]) (if dates - (sort stringlist (hashtable-keys dates))) + (sort string>? (vector->list (hashtable-keys dates))) '()))) + (define (items-newest-first items) + (map cdr + (sort (lambda (left right) + (let ([left-date (car left)] + [right-date (car right)] + [left-item (cdr left)] + [right-item (cdr right)]) + (cond + [(and left-date right-date) + (or (string>? left-date right-date) + (and (string=? left-date right-date) + (string-ci