Add getTags action
This commit is contained in:
parent
d613e184e6
commit
88b375d4a8
@ -445,6 +445,10 @@ class AnkiBridge:
|
|||||||
self.stopEditing()
|
self.stopEditing()
|
||||||
|
|
||||||
|
|
||||||
|
def getTags(self):
|
||||||
|
return self.collection().tags.all()
|
||||||
|
|
||||||
|
|
||||||
def suspend(self, cards, suspend=True):
|
def suspend(self, cards, suspend=True):
|
||||||
for card in cards:
|
for card in cards:
|
||||||
isSuspended = self.isSuspended(card)
|
isSuspended = self.isSuspended(card)
|
||||||
@ -1127,6 +1131,11 @@ class AnkiConnect:
|
|||||||
return self.anki.addTags(notes, tags, False)
|
return self.anki.addTags(notes, tags, False)
|
||||||
|
|
||||||
|
|
||||||
|
@webApi()
|
||||||
|
def getTags(self):
|
||||||
|
return self.anki.getTags()
|
||||||
|
|
||||||
|
|
||||||
@webApi()
|
@webApi()
|
||||||
def suspend(self, cards, suspend=True):
|
def suspend(self, cards, suspend=True):
|
||||||
return self.anki.suspend(cards, suspend)
|
return self.anki.suspend(cards, suspend)
|
||||||
|
20
README.md
20
README.md
@ -845,6 +845,26 @@ guarantee that your application continues to function properly in the future.
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* **getTags**
|
||||||
|
|
||||||
|
Gets the complete list of tags for the current user.
|
||||||
|
|
||||||
|
*Sample request*:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"action": "getTags",
|
||||||
|
"version": 5
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*Sample result*:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"result": ["european-languages", "idioms"],
|
||||||
|
"error": null
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
#### Card Suspension ####
|
#### Card Suspension ####
|
||||||
|
|
||||||
* **suspend**
|
* **suspend**
|
||||||
|
Loading…
Reference in New Issue
Block a user