def METHOD_NAME(self, did: Optional[DeckId] = None) -> Optional[int]:
    did = did or self.col.decks.selected()
    count = self.rebuild_filtered_deck(did).count or None
    if not count:
        return None
    # and change to our new deck
    self.col.decks.select(did)
    return count