mirror of
https://github.com/ankitects/anki.git
synced 2025-12-11 13:56:55 -05:00
support sorting on tags
I don't personally understand it, but some users seem to want it.
This commit is contained in:
parent
00d0447ecb
commit
09a76967e7
2 changed files with 2 additions and 0 deletions
|
|
@ -42,6 +42,7 @@ pub enum SortKind {
|
||||||
NoteField,
|
NoteField,
|
||||||
#[serde(rename = "note")]
|
#[serde(rename = "note")]
|
||||||
NoteType,
|
NoteType,
|
||||||
|
NoteTags,
|
||||||
CardMod,
|
CardMod,
|
||||||
CardReps,
|
CardReps,
|
||||||
CardDue,
|
CardDue,
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ fn write_order(sql: &mut String, kind: &SortKind, reverse: bool) -> Result<()> {
|
||||||
}
|
}
|
||||||
SortKind::CardLapses => "c.lapses",
|
SortKind::CardLapses => "c.lapses",
|
||||||
SortKind::CardInterval => "c.ivl",
|
SortKind::CardInterval => "c.ivl",
|
||||||
|
SortKind::NoteTags => "n.tags",
|
||||||
SortKind::CardDeck => "(select v from sort_order where k = c.did)",
|
SortKind::CardDeck => "(select v from sort_order where k = c.did)",
|
||||||
SortKind::NoteType => "(select v from sort_order where k = n.mid)",
|
SortKind::NoteType => "(select v from sort_order where k = n.mid)",
|
||||||
SortKind::CardTemplate => "(select v from sort_order where k1 = n.mid and k2 = c.ord)",
|
SortKind::CardTemplate => "(select v from sort_order where k1 = n.mid and k2 = c.ord)",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue