diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 51a0fa725..a61473b53 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -779,6 +779,7 @@ exposed_backend_list = [ "get_optimal_retention_parameters", "simulate_fsrs_review", "simulate_fsrs_workload", + "bury_or_suspend_cards", # DeckConfigService "get_ignored_before_count", "get_retention_workload", diff --git a/ts/routes/reviewer/reviewer.ts b/ts/routes/reviewer/reviewer.ts index 3ed0c311a..6679e784b 100644 --- a/ts/routes/reviewer/reviewer.ts +++ b/ts/routes/reviewer/reviewer.ts @@ -1,7 +1,12 @@ // Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -import { CardAnswer, type NextCardDataResponse_NextCardData } from "@generated/anki/scheduler_pb"; import { + BuryOrSuspendCardsRequest_Mode, + CardAnswer, + type NextCardDataResponse_NextCardData, +} from "@generated/anki/scheduler_pb"; +import { + buryOrSuspendCards, compareAnswer, displayEditMenu, getConfigJson, @@ -95,6 +100,17 @@ export class ReviewerState { displayEditMenu({ cid: this.currentCard?.card?.id }); } + public buryCurrentCard() { + if (this.currentCard?.card?.id) { + buryOrSuspendCards({ + cardIds: [this.currentCard?.card?.id], + noteIds: [], + mode: BuryOrSuspendCardsRequest_Mode.BURY_USER, + }); + this.refresh(); + } + } + async handleKeyPress(key: string, ctrl: boolean, shift: boolean) { key = key.toLowerCase(); switch (key) { @@ -136,6 +152,11 @@ export class ReviewerState { } case "e": { this.displayEditMenu(); + break; + } + case "-": { + this.buryCurrentCard(); + break; } } }