mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 22:13:58 -05:00
add deck name field to metadata protobuf msg
This commit is contained in:
parent
2594dcb2bb
commit
651a2b2fac
2 changed files with 14 additions and 9 deletions
|
|
@ -176,29 +176,32 @@ message CsvMetadata {
|
||||||
// to determine the number of columns.
|
// to determine the number of columns.
|
||||||
repeated string column_labels = 5;
|
repeated string column_labels = 5;
|
||||||
oneof deck {
|
oneof deck {
|
||||||
|
// id of an existing deck
|
||||||
int64 deck_id = 6;
|
int64 deck_id = 6;
|
||||||
// One-based. 0 means n/a.
|
// One-based. 0 means n/a.
|
||||||
uint32 deck_column = 7;
|
uint32 deck_column = 7;
|
||||||
|
// name of new deck to be created
|
||||||
|
string deck_name = 8;
|
||||||
}
|
}
|
||||||
oneof notetype {
|
oneof notetype {
|
||||||
// One notetype for all rows with given column mapping.
|
// One notetype for all rows with given column mapping.
|
||||||
MappedNotetype global_notetype = 8;
|
MappedNotetype global_notetype = 9;
|
||||||
// Row-specific notetypes with automatic mapping by index.
|
// Row-specific notetypes with automatic mapping by index.
|
||||||
// One-based. 0 means n/a.
|
// One-based. 0 means n/a.
|
||||||
uint32 notetype_column = 9;
|
uint32 notetype_column = 10;
|
||||||
}
|
}
|
||||||
enum MatchScope {
|
enum MatchScope {
|
||||||
NOTETYPE = 0;
|
NOTETYPE = 0;
|
||||||
NOTETYPE_AND_DECK = 1;
|
NOTETYPE_AND_DECK = 1;
|
||||||
}
|
}
|
||||||
// One-based. 0 means n/a.
|
// One-based. 0 means n/a.
|
||||||
uint32 tags_column = 10;
|
uint32 tags_column = 11;
|
||||||
bool force_delimiter = 11;
|
bool force_delimiter = 12;
|
||||||
bool force_is_html = 12;
|
bool force_is_html = 13;
|
||||||
repeated generic.StringList preview = 13;
|
repeated generic.StringList preview = 14;
|
||||||
uint32 guid_column = 14;
|
uint32 guid_column = 15;
|
||||||
DupeResolution dupe_resolution = 15;
|
DupeResolution dupe_resolution = 16;
|
||||||
MatchScope match_scope = 16;
|
MatchScope match_scope = 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ExportCardCsvRequest {
|
message ExportCardCsvRequest {
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ impl CsvDeckExt for CsvDeck {
|
||||||
match self {
|
match self {
|
||||||
Self::DeckId(did) => NameOrId::Id(*did),
|
Self::DeckId(did) => NameOrId::Id(*did),
|
||||||
Self::DeckColumn(_) => NameOrId::default(),
|
Self::DeckColumn(_) => NameOrId::default(),
|
||||||
|
Self::DeckName(name) => NameOrId::Name(name.into()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,6 +69,7 @@ impl CsvDeckExt for CsvDeck {
|
||||||
match self {
|
match self {
|
||||||
Self::DeckId(_) => None,
|
Self::DeckId(_) => None,
|
||||||
Self::DeckColumn(column) => Some(*column as usize),
|
Self::DeckColumn(column) => Some(*column as usize),
|
||||||
|
Self::DeckName(_) => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue