Anki/rslib/src/storage/card/deck_due_counts.sql
Jarrett Ye 59e143ec25
Feat/support load balance and easy days in rescheduling (#3815)
* Feat/support load balance and easy days in rescheduling

* ./ninja fix:minilints

* apply clippy

* reuse calculate_easy_days_modifiers()

* consider LoadBalancerEnabled

* move calculate_easy_days_modifiers out of struct

* improve naming & add comments

* apply clippy

* reschedule if easy days settings are changed

* Minor simplification

* refactor to share code between load balancer and rescheduler

* intervals_and_params -> intervals_and_weights

* find_best_interval -> select_weighted_interval

* cargo clippy

* add warning about easyDaysChanged

* compare arrays directly

* Don't show warning if fsrs+rescehdule is already enabled

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Co-authored-by: Jake Probst <jake.probst@gmail.com>
2025-02-18 13:44:00 +07:00

14 lines
No EOL
241 B
SQL

SELECT CASE
WHEN odid == 0 THEN did
ELSE odid
END AS original_did,
CASE
WHEN odid == 0 THEN due
ELSE odue
END AS true_due,
COUNT() AS COUNT
FROM cards
WHERE type = 2
AND queue != -1
GROUP BY original_did,
true_due