Remove unused backend methods & formatting

This commit is contained in:
abdo 2021-01-09 17:48:34 +03:00
parent 5919d9273f
commit 0b5bb711a1
2 changed files with 137 additions and 159 deletions

View File

@ -66,10 +66,6 @@ message DeckConfigID {
int64 dcid = 1; int64 dcid = 1;
} }
message TagID {
int64 tid = 1;
}
// New style RPC definitions // New style RPC definitions
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -144,7 +140,8 @@ service BackendService {
// deck config // deck config
rpc AddOrUpdateDeckConfigLegacy (AddOrUpdateDeckConfigLegacyIn) returns (DeckConfigID); rpc AddOrUpdateDeckConfigLegacy(AddOrUpdateDeckConfigLegacyIn)
returns (DeckConfigID);
rpc AllDeckConfigLegacy(Empty) returns (Json); rpc AllDeckConfigLegacy(Empty) returns (Json);
rpc GetDeckConfigLegacy(DeckConfigID) returns (Json); rpc GetDeckConfigLegacy(DeckConfigID) returns (Json);
rpc NewDeckConfigLegacy(Empty) returns (Json); rpc NewDeckConfigLegacy(Empty) returns (Json);
@ -212,8 +209,6 @@ service BackendService {
rpc RegisterTags(RegisterTagsIn) returns (Bool); rpc RegisterTags(RegisterTagsIn) returns (Bool);
rpc AllTags(Empty) returns (AllTagsOut); rpc AllTags(Empty) returns (AllTagsOut);
rpc GetTag (String) returns (Tag);
rpc UpdateTag (Tag) returns (Bool);
rpc SetTagCollapsed(SetTagCollapsedIn) returns (Bool); rpc SetTagCollapsed(SetTagCollapsedIn) returns (Bool);
rpc ClearTag(String) returns (Bool); rpc ClearTag(String) returns (Bool);
rpc TagTree(Empty) returns (TagTreeNode); rpc TagTree(Empty) returns (TagTreeNode);

View File

@ -1300,23 +1300,6 @@ impl BackendService for Backend {
Ok(pb::AllTagsOut { tags }) Ok(pb::AllTagsOut { tags })
} }
fn get_tag(&self, name: pb::String) -> BackendResult<pb::Tag> {
self.with_col(|col| {
if let Some(tag) = col.storage.get_tag(name.val.as_str())? {
Ok(tag.into())
} else {
Err(AnkiError::NotFound)
}
})
}
fn update_tag(&self, tag: pb::Tag) -> BackendResult<pb::Bool> {
self.with_col(|col| {
col.update_tag(&tag.into())?;
Ok(pb::Bool { val: true })
})
}
fn set_tag_collapsed(&self, input: pb::SetTagCollapsedIn) -> BackendResult<pb::Bool> { fn set_tag_collapsed(&self, input: pb::SetTagCollapsedIn) -> BackendResult<pb::Bool> {
self.with_col(|col| { self.with_col(|col| {
let name = &input.name; let name = &input.name;