From 55d68c01d8b2f8f6fea50f30108181ceac8f7f51 Mon Sep 17 00:00:00 2001 From: Abdo Date: Fri, 28 Jun 2024 14:53:16 +0300 Subject: [PATCH] Shuffle identical values in filtered deck sort (#3259) * Shuffle identical values in filtered deck sort * Update test --- pylib/tests/test_schedv3.py | 5 ----- rslib/src/storage/card/filtered.rs | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/pylib/tests/test_schedv3.py b/pylib/tests/test_schedv3.py index 9720250ee..2a1f79213 100644 --- a/pylib/tests/test_schedv3.py +++ b/pylib/tests/test_schedv3.py @@ -724,7 +724,6 @@ def test_preview(): note["Front"] = "one" col.addNote(note) c = note.cards()[0] - orig = copy.copy(c) note2 = col.newNote() note2["Front"] = "two" col.addNote(note2) @@ -757,10 +756,6 @@ def test_preview(): assert c2.reps == 0 assert c2.type == CARD_TYPE_NEW - # the other card should appear again - c = col.sched.getCard() - assert c.id == orig.id - # emptying the filtered deck should restore card col.sched.empty_filtered_deck(did) c.load() diff --git a/rslib/src/storage/card/filtered.rs b/rslib/src/storage/card/filtered.rs index 00f1839ab..b4668bbec 100644 --- a/rslib/src/storage/card/filtered.rs +++ b/rslib/src/storage/card/filtered.rs @@ -46,5 +46,5 @@ then (ivl / cast({today}-due+0.001 as real)) else 100000+due end)", } }; - format!("{} limit {}", order, term.limit) + format!("{}, fnvhash(c.id, c.mod) limit {}", order, term.limit) }