[Userscript] WaniKani Dashboard SRS and Leech Breakdown

Yeah, more or less. It’s the same query against the same data.

1 Like

Okay, thanks. I didn’t know that existed. I wonder if that should default to true though. :thinking:

@rfindley Can I apply the in_review filter if I’m using ItemData.get_items or would I have to switch to Apiv2.fetch_endpoint? If the latter, would it be possible/reasonable to offer that option natively in Open Framework?

@seanblue,

var options = {
    filters: {
        in_review: true   // or quoted "true" ??
    }
};
ItemData.get_items('assignments', options);

The option parameter ends up getting passed to Apiv2.fetch_endpoint

1 Like

Great, thanks!

@Orimazer I’d like to fix this issue in the script. I can make a best attempt, send you a copy of the script, and have you tell me if it works. Or, if you don’t mind, you can generate a new read-only API key so I can verify it myself. And once I’m done, you can expire the key. Which way do you prefer?

On second thought… Since ItemData.get_items() caches the results, any queries you do with a filter will affect other scripts, too. It’s probably best to just use a filter function after fetching data without url-based filters.

items = items.filter(item => item.assignments.in_review)

It sounds like Open Framework shouldn’t accept those filters for ItemData at all then. It would be unfortunate for a script to accidentally break a bunch of other scripts because of that caching behavior.

I think that’s probably the reason I didn’t document ‘filters’ as an option on get_items(). But yeah… when I get time to address my list of changes, I think I’ll scrub ‘filters’ from the ‘options’ on get_items(). as a precaution.

1 Like

Weird bug :face_with_monocle:

image

EDIT: Well, so I had this another SRS breakdown script which when I removed, fixed this bug. Funnily enough though, it never worked on it’s own and showed nothing before I added this script.

That happened to me too

Heya, I seem to be consistently missing a leech compared to the leech list script. Is there a possibility you might know what could cause this discrepancy?

42+270+171+73 = 556

Maybe that other script isn’t filtering out leeches at Burn level?

I think it is. I have already burned many leeches, not just one.

I don’t have any other ideas off the top of my head.

1 Like

Does clicking on the leech number to display the leeches work for anyone?
Doesn’t work in Safari nor Firefox for me.

That’s not a feature of this script…

Wonk :wink:

1 Like

Wasn’t it a feature of the original script?
So I tought it should work here aswell:

I only reimplemented the part of the script I cared about, so no that feature isn’t supported here.

I’m not sure I understand the educational value of knowing how many leeches there, but not being able to see a list of them. How is seeing that number helping me to learn?