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

View File

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

View File

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