From 367c77166b006b0e32daa09bb47090db246b57ca Mon Sep 17 00:00:00 2001 From: RumovZ Date: Wed, 11 May 2022 16:36:13 +0200 Subject: [PATCH] =?UTF-8?q?factor=20=E2=86=92=20ease=5Ffactor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pylib/anki/foreign_data/__init__.py | 8 ++++---- pylib/anki/foreign_data/mnemosyne.py | 2 +- rslib/src/import_export/text/import.rs | 2 +- rslib/src/import_export/text/mod.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pylib/anki/foreign_data/__init__.py b/pylib/anki/foreign_data/__init__.py index f878c0871..0b41f0254 100644 --- a/pylib/anki/foreign_data/__init__.py +++ b/pylib/anki/foreign_data/__init__.py @@ -77,15 +77,15 @@ class ForeignCard: Usually a review card, as the default card generation routine will take care of missing new cards. - due -- UNIX timestamp - interval -- days - factor -- decimal fraction (2.5 corresponds to default ease) + due -- UNIX timestamp + interval -- days + ease_factor -- decimal fraction (2.5 corresponds to default ease) """ # TODO: support new and learning cards? due: int = 0 interval: int = 1 - factor: float = STARTING_FACTOR_FRACTION + ease_factor: float = STARTING_FACTOR_FRACTION reps: int = 0 lapses: int = 0 diff --git a/pylib/anki/foreign_data/mnemosyne.py b/pylib/anki/foreign_data/mnemosyne.py index 56b62492e..d1eeb4291 100644 --- a/pylib/anki/foreign_data/mnemosyne.py +++ b/pylib/anki/foreign_data/mnemosyne.py @@ -143,7 +143,7 @@ class MnemoCard: def foreign_card(self) -> ForeignCard: return ForeignCard( - factor=self.easiness, + ease_factor=self.easiness, reps=self.reps, lapses=self.lapses, interval=self.anki_interval(), diff --git a/rslib/src/import_export/text/import.rs b/rslib/src/import_export/text/import.rs index f17adfff8..deb0eef8e 100644 --- a/rslib/src/import_export/text/import.rs +++ b/rslib/src/import_export/text/import.rs @@ -193,7 +193,7 @@ impl ForeignCard { fn into_native(self, note_id: NoteId, template_idx: u16, deck_id: DeckId, today: u32) -> Card { let mut card = Card::new(note_id, template_idx, deck_id, self.native_due(today)); card.interval = self.interval; - card.ease_factor = (self.factor * 1000.).round() as u16; + card.ease_factor = (self.ease_factor * 1000.).round() as u16; card.reps = self.reps; card.lapses = self.lapses; card diff --git a/rslib/src/import_export/text/mod.rs b/rslib/src/import_export/text/mod.rs index b0442504a..44db101fb 100644 --- a/rslib/src/import_export/text/mod.rs +++ b/rslib/src/import_export/text/mod.rs @@ -31,7 +31,7 @@ pub struct ForeignNote { pub struct ForeignCard { pub due: i32, pub interval: u32, - pub factor: f32, + pub ease_factor: f32, pub reps: u32, pub lapses: u32, }