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,
did
FROM cards
WHERE ord = 0
AND nid IN (
WHERE nid IN (
SELECT nid
FROM search_nids
)
)
GROUP BY nid
HAVING ord = MIN(ord)

View file

@ -131,7 +131,7 @@ impl SqliteStorage {
.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>> {
self.db
.prepare_cached(include_str!("all_decks_of_search_notes.sql"))?