From f18f4e387bcac572a96147a91e0dbe9b3fcb64ad Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 15 Apr 2020 15:02:12 +1000 Subject: [PATCH] older clients require 'separate' on filtered decks the deckconf['new']['separate' property is unused, but older code assumes filtered['separate'] exists, even though it doesn't do anything with it https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48240796 --- rslib/src/deckconf.rs | 5 ----- rslib/src/decks.rs | 7 +++++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/rslib/src/deckconf.rs b/rslib/src/deckconf.rs index a189d35b5..3bd6c568b 100644 --- a/rslib/src/deckconf.rs +++ b/rslib/src/deckconf.rs @@ -55,10 +55,6 @@ pub struct NewConf { #[serde(deserialize_with = "default_on_invalid")] pub(crate) per_day: u32, - // unused, can remove in the future - #[serde(default)] - separate: bool, - #[serde(flatten)] other: HashMap, } @@ -165,7 +161,6 @@ impl Default for NewConf { ints: NewCardIntervals::default(), order: NewCardOrder::default(), per_day: 20, - separate: true, other: Default::default(), } } diff --git a/rslib/src/decks.rs b/rslib/src/decks.rs index 070ce245e..227e6e6bd 100644 --- a/rslib/src/decks.rs +++ b/rslib/src/decks.rs @@ -55,8 +55,7 @@ mod dynfix { ); } - // remove some obsolete keys - map.remove("separate"); + // remove an obsolete key map.remove("return"); let rest = Value::Object(map); @@ -116,6 +115,10 @@ pub struct FilteredDeck { resched: bool, terms: Vec, + // unused, but older clients require its existence + #[serde(default)] + separate: bool, + // old scheduler #[serde(default, deserialize_with = "default_on_invalid")] delays: Option>,