feat(scheduler): add from_queue flag to CardAnswer (#3976)

Co-authored-by: Yaoliang <yaoliang.ch@gmail.com>
This commit is contained in:
Yaoliang Chen 2025-05-03 17:21:48 +08:00 committed by GitHub
parent bd67e9fe1b
commit 1f95d030bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 3 deletions

View file

@ -225,6 +225,7 @@ babofitos <https://github.com/babofitos>
Jonathan Schoreels <https://github.com/JSchoreels>
JL710
Matt Brubeck <mbrubeck@limpet.net>
Yaoliang Chen <yaoliang.ch@gmail.com>
********************

View file

@ -279,6 +279,7 @@ message CardAnswer {
Rating rating = 4;
int64 answered_at_millis = 5;
uint32 milliseconds_taken = 6;
optional bool from_queue = 7;
}
message CustomStudyRequest {

View file

@ -163,10 +163,10 @@ impl Collection {
rating,
milliseconds_taken: 0,
answered_at_millis: TimestampMillis::now().into(),
// Process the card without updating queues yet
from_queue: Some(false),
}
.into();
// Process the card without updating queues yet
answer.from_queue = false;
col.answer_card_inner(&mut answer)?;
}
Ok(())

View file

@ -21,7 +21,7 @@ impl From<anki_proto::scheduler::CardAnswer> for CardAnswer {
answered_at: TimestampMillis(answer.answered_at_millis),
milliseconds_taken: answer.milliseconds_taken,
custom_data,
from_queue: true,
from_queue: answer.from_queue.unwrap_or(true),
}
}
}