Fix deck export for notes with missing card 1

This commit is contained in:
RumovZ 2022-06-07 13:37:10 +02:00
parent 4d98f0656e
commit be8442cfbe
2 changed files with 5 additions and 4 deletions

View file

@ -1,8 +1,9 @@
SELECT nid, SELECT nid,
did did
FROM cards FROM cards
WHERE ord = 0 WHERE nid IN (
AND nid IN (
SELECT nid SELECT nid
FROM search_nids FROM search_nids
) )
GROUP BY nid
HAVING ord = MIN(ord)

View file

@ -131,7 +131,7 @@ impl SqliteStorage {
.collect() .collect()
} }
/// Returns the deck id of the first card of every searched note. /// Returns the deck id of the first existing card of every searched note.
pub(crate) fn all_decks_of_search_notes(&self) -> Result<HashMap<NoteId, DeckId>> { pub(crate) fn all_decks_of_search_notes(&self) -> Result<HashMap<NoteId, DeckId>> {
self.db self.db
.prepare_cached(include_str!("all_decks_of_search_notes.sql"))? .prepare_cached(include_str!("all_decks_of_search_notes.sql"))?