Related Items repeater on dynamic page

Thanks! This is getting much closer!
Instead of filtering the repeater items to match the category of the current dynamic page, the items are filtered to match the category “music” (the first value in the categories database) on every dynamic page, regardless of what the dynamic page’s true category is.

I tried pulling the current dynamic page’s category from the dynamicDataset instead of eventsDataset (just changing the line below), but then the repeater returns no results at all.
let category = $w(“dynamicDataset”).getCurrentItem().category;

Any tips on why this could be? I’m at a loss!