Extra Stats in Deck Browser

I’ve created an addon to display extra stats in the deck browser.

At the moment it’s extremely simple. Just adds two columns to display “unseen” and “total” for each deck.

More functionality may be added.

I’m getting the following error upon starting Anki:

Error
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed.
If the issue only occurs when add-ons are enabled, please use the Tools > Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem.
When you've discovered the add-on that is causing the problem, please report the issue on the add-on support site.
Debug info:
Anki 2.1.47 (dc156f34) Python 3.8.6 Qt 5.14.2 PyQt 5.14.2
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2021-09-11 00:09:07

Traceback (most recent call last):
  File "google\protobuf\internal\python_message.py", line 713, in field_setter
  File "google\protobuf\internal\type_checkers.py", line 166, in CheckValue
TypeError: '1604312750882' has type <class 'str'>, but expected one of: (<class 'int'>,)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "google\protobuf\internal\python_message.py", line 569, in init
  File "google\protobuf\internal\python_message.py", line 715, in field_setter
TypeError: Cannot set anki.decks.DeckId.did to '1604312750882': '1604312750882' has type <class 'str'>, but expected one of: (<class 'int'>,)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aqt\main.py", line 523, in loadCollection
  File "aqt\main.py", line 672, in moveToState
  File "aqt\main.py", line 679, in _deckBrowserState
  File "aqt\deckbrowser.py", line 68, in show
  File "aqt\deckbrowser.py", line 143, in _renderPage
  File "aqt\deckbrowser.py", line 152, in __renderPage
  File "aqt\hooks_gen.py", line 1275, in __call__
  File "C:\Users\adamh\AppData\Roaming\Anki2\addons21\93718002\__init__.py", line 59, in inject_extra_data_to_deck_browser
    mw.col.decks.select(id_num)
  File "anki\decks.py", line 429, in select
  File "anki\decks.py", line 413, in set_current
  File "anki\_backend\generated.py", line 283, in set_current_deck
  File "google\protobuf\internal\python_message.py", line 571, in init
  File "google\protobuf\internal\python_message.py", line 488, in _ReraiseTypeErrorWithFieldName
  File "six.py", line 718, in reraise
  File "google\protobuf\internal\python_message.py", line 569, in init
  File "google\protobuf\internal\python_message.py", line 715, in field_setter
TypeError: Cannot set anki.decks.DeckId.did to '1604312750882': '1604312750882' has type <class 'str'>, but expected one of: (<class 'int'>,) for field DeckId.did

I’m not the author but I have patched it:
go to tools → addons → select the extra stats in deck browser addon → view files →
then just change these lines in “init.py” so that it casts these strs to ints

                    #This gets the total number of cards in the deck.
                    num_cards = mw.col.decks.card_count(int(id_num), True)
                    #To get other stats data, we need to select the deck.
                    mw.col.decks.select(int(id_num))

yo I patched your program for you so update it on ankiweb