Revert "Use scheduling flag instead of checking revlog when importing decks (#2730)"

This reverts commit e1e0f2e1bd.

The previous change breaks the assumption on this line:

                DeckKind::Filtered(_) => unreachable!(),

This will likely need a bigger refactor to handle this properly, and separate
out importing of deck configs from other scheduling data.
This commit is contained in:
Damien Elmes 2023-10-26 09:49:24 +10:00
parent 48dfe502f2
commit ceb8a4ac20

View File

@ -47,7 +47,6 @@ struct Context<'a> {
data: ExchangeData, data: ExchangeData,
usn: Usn, usn: Usn,
progress: ThrottlingProgressHandler<ImportProgress>, progress: ThrottlingProgressHandler<ImportProgress>,
with_scheduling: bool,
} }
impl Collection { impl Collection {
@ -93,7 +92,6 @@ impl<'a> Context<'a> {
merge_notetypes: options.merge_notetypes, merge_notetypes: options.merge_notetypes,
update_notes: options.update_notes(), update_notes: options.update_notes(),
update_notetypes: options.update_notetypes(), update_notetypes: options.update_notetypes(),
with_scheduling: options.with_scheduling,
media_manager, media_manager,
archive, archive,
meta, meta,
@ -113,7 +111,7 @@ impl<'a> Context<'a> {
let mut media_map = self.prepare_media()?; let mut media_map = self.prepare_media()?;
let note_imports = self.import_notes_and_notetypes(&mut media_map)?; let note_imports = self.import_notes_and_notetypes(&mut media_map)?;
let keep_filtered = self.data.enables_filtered_decks(); let keep_filtered = self.data.enables_filtered_decks();
let contains_scheduling = self.with_scheduling; let contains_scheduling = self.data.contains_scheduling();
let imported_decks = self.import_decks_and_configs(keep_filtered, contains_scheduling)?; let imported_decks = self.import_decks_and_configs(keep_filtered, contains_scheduling)?;
self.import_cards_and_revlog( self.import_cards_and_revlog(
&note_imports.id_map, &note_imports.id_map,