anki-connect icon indicating copy to clipboard operation
anki-connect copied to clipboard

Added getReviewsOfCards

Open Aquafina-water-bottle opened this issue 3 years ago • 1 comments
trafficstars

This introduces an API action to get review data of the specified cards, compared to cardReviews which returns all the reviews after a given time.

Use case

Although I'm not completely sure what other practical applications this can have, for me in particular, I'm interested in getting the earliest review time of a card to sort by for a small application in my Anki template. I figured that instead of making a specific API call to get the earliest / latest review time of a card, a more general API action like this should suffice.

Additional Notes

Again with naming, given that there is a cardReviews call that already exists, I'm hoping this name is good. If you have any suggestions for potentially better names that is sufficiently different from cardReviews, please let me know!

Thanks!

Aquafina-water-bottle avatar Sep 05 '22 06:09 Aquafina-water-bottle

I see you made some changes, here but the inner lists are still not dictionaries.


            "1653613948202": [
                [1654102387663, 1653613948202, 1780, 3,   8,  3, 2500, 25796, 1],
                [1654798974478, 1653613948202, 1861, 3,  20,  8, 2500, 18134, 1],
                [1656556319328, 1653613948202, 2075, 3,  53, 20, 2500, 20530, 1],
                [1661107990069, 1653613948202, 2478, 3, 131, 53, 2500, 24247, 1]
            ]

FooSoft avatar Sep 17 '22 21:09 FooSoft

Sorry for the delay! I misunderstood the request from earlier, but now the result is the following:

{
    "1653613948202": [
        {
            "id": 1653772912146,
            "usn": 1750,
            "ease": 1,
            "ivl": -20,
            "lastIvl": -20,
            "factor": 0,
            "time": 38192,
            "type": 0
        },
        {
            "id": 1653772965429,
            "usn": 1750,
            "ease": 3,
            "ivl": -45,
            "lastIvl": -20,
            "factor": 0,
            "time": 15337,
            "type": 0
        }
    ]
}

Additionally, I removed the cid section within the dictionaries.

Aquafina-water-bottle avatar Sep 20 '22 23:09 Aquafina-water-bottle