add actual assocation between the statistics elements

This commit is contained in:
Logan Hunt 2022-06-04 13:28:23 -07:00
parent cd5d87c4f5
commit dd5ce5c86b
Signed by untrusted user who does not match committer: simponic
GPG Key ID: 52B3774857EB24B1
3 changed files with 11 additions and 10 deletions

View File

@ -69,12 +69,13 @@
(sxql:where (:= :category_id (mito:object-id category)))))
(defun statistics (category-splits)
`((SPLIT-PBS ,(mapcar (lambda (category) (getf (best-category-split category) :ELAPSED)) csplits))
(BEST-CATEGORY-RUN-SPLITS ,(or
(mapcar (lambda (split)
(millis-since-internal-timestamp 0 (run-split-elapsed-time split)))
(ignore-errors
(run-splits (mito:find-dao 'run :id (getf (best-category-run category) :RUN-ID)))))
(mapcar (lambda (csplit) nil) csplits)))))
(defun statistics (category)
(let ((csplits (category-splits category)))
`((SPLIT-PBS . ,(mapcar (lambda (csplit) (getf (best-category-split csplit) :ELAPSED)) csplits))
(BEST-CATEGORY-RUN-SPLITS . ,(or
(mapcar (lambda (split)
(millis-since-internal-timestamp 0 (run-split-elapsed-time split)))
(ignore-errors
(run-splits (mito:find-dao 'run :id (getf (best-category-run category) :RUN-ID)))))
(mapcar (lambda (csplit) nil) csplits))))))

View File

@ -109,9 +109,9 @@
(let ((choice (select-option '(("Help" . HELP)
("Import a category" . IMPORT-CATEGORY)
("Make a new category" . NEW-CATEGORY)
("Delete a category" . DELETE-CATEGORY)
("Start a speedrun" . START-SPEEDRUN)
("View splits of a speedrun" . VIEW-SPEEDRUNS)
("Delete a category" . DELETE-CATEGORY)
("Delete a speedrun" . DELETE-SPEEDRUN)
("Exit" . EXIT)))))
(case choice

View File

@ -110,7 +110,7 @@
(redraws '(title-instance))
(speedrun (make-speedrun category))
(csplits (category-splits category))
(bests (statistics csplits))
(bests (statistics category))
(split-pbs (cdr (assoc 'SPLIT-PBS bests)))
(best-category-run-pbs (cdr (assoc 'BEST-CATEGORY-RUN-SPLITS bests))))