"Note Size" addon support

Hello everyone,

Here I’d introduce the new “Note Size” addon which allows you to control the size of your collection.
It displays note size, including attached files.

Currently implemented features

  1. Adding a “Size” column to the Browser, which can be sorted to quickly find the largest notes.
  2. Showing note size in real-time while creating or editing it.
  3. Showing details about note size.
  4. Collection and media size in the Deck Browser

Screenshots

Editing note:

Adding new note:

Links

In this topic, I’ll be glad to see any feedback, ideas, issues, or questions. Thanks!

9 Likes

Added 3 columns in the Browser (total note size, texts only, files only):

2 Likes

New release of “Note Size” add-on:
shows full collection and media size (like in AnkiWeb)

4 Likes

New release 1.15.0.

Main change:
The Size button in the Editor is highlighted depending on the note size:
green <100KB, orange 100KB-1MB, red >1MB.
Colors can be disabled or configured as you need.

2 Likes

New release 2.0.0.

Main change: add GUI for configuration

It’s a big update. If you encounter any problems, please, let me know.

2 Likes

New release: 2.2.0 (change log)

Main changes:

  1. Display “Unused” and “Trash” collection sizes in Deck Browser
  2. Show cache initialization progress dialog (happens only once on the 1st start)


3 Likes

New release 2.3.0 (changelog)

Main changes:

  1. New note size details dialog
  2. Speed up cache initialization

Screenshot from 2024-09-06 19-02-06

2 Likes

New release Note Size 2.4.0 (changelog)

Main changes:

  1. Show total size of all notes found in the browser

If you don’t need it, you can disable this button in the configuration:

image

1 Like

New release Note Size 2.5.0 (changelog):

  1. Speed up cache initialization on the 1st start
  2. Fix blocking Deck Browser on startup until cache is initialized
  3. Fix not working “Refresh cache” button when cache warmup is disabled

If you’re experiencing any issues, post a comment in this thread.

New release Note Size 2.5.1 (changelog):

  1. Do not save caches to file if caches were not initialized
  2. Read cache file in background
1 Like

New release Note Size 2.5.2 (changelog):

  1. [BUG] Size calculator properly handles files used in several notes
  2. [BUG] Refresh BrowserButton when clicked
  3. [MISC] Profiler does not overwrite previous reports

New release Note Size 2.5.3 (changelog):

  1. [BUG] Error when click on Browser Button in cards mode

I remember older versions of the addon showing more decimal places where now the size seems to be rounded up to an integer value

image
Is there a config setting to bring back more detailed info?

1 Like

Nope, the precision setting is not exposed to configuration (neither JSON, nor UI) in current version.
But I have a plan to do it in future versions.

1 Like

New release Note Size 2.6.0 (changelog):

  1. [FEATURE] Display missing media files
  2. [FEATURE] Show number of notes in used Media tooltip
  3. [FEATURE] Add “Size Precision” configuration property (JSON only)

@Eltaurus , in this version it’s possible to configure size precision via addon JSON config (Anki restart is required). I’m going to expose these properties to UI config in future versions.

2 Likes

It might be a good idea to set the overall number of significant digits instead of the size of the fractional part itself because it doesn’t make much sense to display numbers like 500 and 1 with the same decimal tail:

image

But the setting already makes the whole thing much more useful. Thank you!

1 Like

New release Note Size 2.6.1 (changelog):

  1. [FEATURE] Replace “Size Precision” configuration property with “Significant Digits” (JSON only)


@Eltaurus , it’s a good remark about the significant digits, thank you. I implemented it in this version. Please, try it out

2 Likes

It’s perfect now

2 Likes

Just found about this add-on and tried it out, but it seems to be giving an error.

The error is too large to post though. I’m on MacOS.

Thank you for reporting.

Unfortunately, I’ve never tested this addon on Mac because I don’t use any Apple devices.

I’d appreciate if you can copy the debug info:

And just post it here as is:

Anki 24.11 (87ccd24e) (ao)
Python 3.9.18 Qt 6.6.2 PyQt 6.6.1
Platform: Linux-6.8.0-51-generic-x86_64-with-glibc2.35

Traceback (most recent call last):
File “aqt.main”, line 380, in onOpenProfile
File “aqt.main”, line 558, in loadProfile
File “_aqt.hooks”, line 4101, in call
File “/home/aleks/.local/share/Anki2/addons21/1188705668/cache/cache_hooks.py”, line 53, in __initialize_cache_on_startup
self.__cache_initializer.warmup_caches()
File “/home/aleks/.local/share/Anki2/addons21/1188705668/cache/cache_initializer.py”, line 33, in warmup_caches
self.__initialize_caches(self.__parent, False)
File “/home/aleks/.local/share/Anki2/addons21/1188705668/cache/cache_initializer.py”, line 57, in __initialize_caches
cache_initializer_op.initialize_cache_in_background()
File “/home/aleks/.local/share/Anki2/addons21/1188705668/cache/cache_initializer_op.py”, line 41, in initialize_cache_in_background
query_op.run_in_background()
File “aqt.operations”, line 263, in run_in_background
File “aqt.operations”, line 281, in _run
File “aqt.taskman”, line 110, in with_progress
File “aqt.taskman”, line 71, in run_in_background
File “aqt.taskman”, line 144, in _on_closures_pending
File “aqt.taskman”, line 88, in
File “aqt.operations”, line 261, in wrapped_done
File “aqt.deckbrowser”, line 171, in success
File “aqt.deckbrowser”, line 187, in __renderPage
File “_aqt.hooks”, line 1837, in call
File “/home/aleks/.local/share/Anki2/addons21/1188705668/ui/deck_browser/deck_browser_hooks.py”, line 41, in __on_browser_will_render_content
html: str = self.__collection_size_formatter.format_collection_size_html()
File “/home/aleks/.local/share/Anki2/addons21/1188705668/ui/deck_browser/collection_size_formatter.py”, line 48, in format_collection_size_html
used_files: UsedFiles = self.__used_files_calculator.get_used_files_size(use_cache=True)
File “/home/aleks/.local/share/Anki2/addons21/1188705668/calculator/used_files_calculator.py”, line 36, in get_used_files_size
note_ids: list[NoteId] = self.__col.db.list(“select id from notes”)
AttributeError: ‘NoneType’ object has no attribute ‘list’

===Add-ons (active)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
‘’ [‘Cython-CythonAddon-src’, 0, ‘None’, ‘’]
AnkiRestart - Quick Anki Rebooter for Customize Develop Created by Shige [‘237169833’, 2024-10-11T10:28, ‘None’, mod]
AwesomeTTS - Add speech to your flashcards [‘1436550454’, 2024-12-06T08:28, ‘None’, ‘’]
Browser search result highlighter [‘1057317630’, 2025-01-09T21:40, ‘None’, ‘’]
Cross-Field Highlighter - spotlight word in text [‘1312127886’, 2025-01-03T10:24, ‘v1.1.0’, ‘’]
Note Size - sort notes by size and see collection size [‘1188705668’, 2025-01-13T14:03, ‘v2.6.1’, ‘’]

===IDs of active AnkiWeb add-ons===
1057317630 1188705668 1312127886 1436550454 237169833

===Add-ons (inactive)===
(add-on provided name [Add-on folder, installed at, version, is config changed])
‘’ [‘AddonConfig-OpenAddonConfigDialog’, 0, ‘None’, mod]
‘’ [‘AddonConfig-ReadWriteAddonConfig’, 0, ‘None’, ‘’]
‘’ [‘AddonInfo’, 0, ‘None’, ‘’]
‘’ [‘Collection’, 0, ‘None’, ‘’]
‘’ [‘Dependencies-addon_with_dependency’, 0, ‘None’, ‘’]
‘’ [‘Dependencies-addon_with_dependency_pip’, 0, ‘None’, ‘’]
‘’ [‘GUI-QProgressDialog’, 0, ‘None’, ‘’]
‘’ [‘GUI-QtAPI-NoteSizeConfig’, 0, ‘None’, ‘’]
‘’ [‘GUI-QtAPI-QDialogButtonBox’, 0, ‘None’, ‘’]
‘’ [‘Hook-GenHooks-FieldFilter’, 0, ‘None’, ‘’]
‘’ [‘Hook-GenHooks-NoteWillBeAdded’, 0, ‘None’, ‘’]
‘’ [‘Hook-GenHooks-NoteWillFlush’, 0, ‘None’, ‘’]
‘’ [‘Hook-GenHooks-NotesWereUpdated’, 0, ‘None’, ‘’]
‘’ [‘Hook-GenHooks-NotesWillBeDeleted’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-AddCards-AddCardsDidAddNote’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Browser-BrowserDidFetchColumns’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Browser-BrowserDidFetchRow’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Browser-BrowserDidSearch’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Browser-BrowserWillSearch’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Browser-BrowserWillShow’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Browser-BrowserWillShowContextMenu’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Collection-CollectionDidLoad’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-DeckBrowser-DeckBrowserDidRender’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-DeckBrowser-DeckBrowserWillRenderContent’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorDidFireTypingTimer’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorDidInit’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorDidInitButtons’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorDidLoadNote’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorDidPaste’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorDidUnfocusField’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorStateDidChange’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Editor-EditorWebViewDidInit’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Focus-FocusDidChange’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-MainWindow-MainWindowDidInit’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Profile-ProfileDidOpen’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Profile-ProfileWillClose’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Reviewer-ReviewerDidInit’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Reviewer-ReviewerDidShowQuestion’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Reviewer-ReviewerWillShowContextMenu’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Stats-StatsDialogWillShow’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Sync-MediaSyncDidProgress’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Sync-MediaSyncDidStartOrStop’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Sync-SyncDidFinish’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-Sync-SyncWillStart’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-WebView-WebViewDidReceiveJsMessage’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-WebView-WebviewDidInjectStyleIntoPage’, 0, ‘None’, ‘’]
‘’ [‘Hook-GuiHooks-WebView-WebviewWillSetContent’, 0, ‘None’, ‘’]
‘’ [‘Logging-AddonManager’, 0, ‘None’, ‘’]
‘’ [‘Logging-log_to_file_basic’, 0, ‘None’, ‘’]
‘’ [‘Logging-log_to_file_handler’, 0, ‘None’, ‘’]
‘’ [‘Logging-log_to_stderr’, 0, ‘None’, ‘’]
‘’ [‘Media-OpenCheckMediaDialog’, 0, ‘None’, ‘’]
‘’ [‘OpenAI’, 0, ‘None’, ‘’]
‘’ [‘SortByCustomColumn’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-CollectionOp’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-ProgressManager-ProgressManager’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-FailureCallback’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-FailurePopup’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-NoProgress’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-NoProgressInherit’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-WithProgressConcurrent’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-WithProgressCounter’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-WithProgressCounterInherit’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-WithProgressNoCounter’, 0, ‘None’, ‘’]
‘’ [‘UI-BackgroundOperations-QueryOp-RunInBackground-WithoutCollection’, 0, ‘None’, ‘’]
‘’ [‘UI-Browser-RefreshCurrentNote’, 0, ‘None’, ‘’]
‘’ [‘UI-Browser-ShowHideColumn’, 0, ‘None’, ‘’]
‘’ [‘UI-BrowserDoSearch’, 0, ‘None’, ‘’]
‘’ [‘UI-BrowserSelectedNotes’, 0, ‘None’, ‘’]
‘’ [‘UI-BrowserUpdate’, 0, ‘None’, ‘’]
‘’ [‘UI-DeckBrowserRefresh’, 0, ‘None’, ‘’]
‘’ [‘UI-DialogManager’, 0, ‘None’, ‘’]
‘’ [‘UI-MainWindowMenuItem’, 0, ‘None’, ‘’]
‘’ [‘Utils-ShowException’, 0, ‘None’, ‘’]
‘’ [‘Utils-ShowInfo’, 0, ‘None’, ‘’]
‘’ [‘cross_field_highlighter’, 0, ‘None’, ‘’]
Advanced Copy Fields Qt6 [‘287110490’, 2023-11-11T00:52, ‘None’, ‘’]
AnkiConnect [‘2055492159’, 2024-11-07T08:34, ‘None’, ‘’]
Batch Download Pictures From Google Images [‘561924305’, 2024-05-03T02:36, ‘None’, ‘’]
Batch Editing [‘291119185’, 2023-10-26T07:38, ‘None’, ‘’]
Customize Keyboard Shortcuts [‘24411424’, 2023-11-01T16:17, ‘None’, ‘’]
Fast Word Query 3 [‘1956435337’, 2024-04-12T01:01, ‘None’, ‘’]
Google Translate [‘1536291224’, 2025-01-14T18:51, ‘None’, mod]
Highlight Search Results in the Browser [‘225180905’, 2023-10-22T02:17, ‘None’, ‘’]
Mini Format Pack [‘295889520’, 2023-11-03T01:00, ‘None’, ‘’]
Show Duplicates Shortcut [‘689277073’, 2022-11-05T08:58, ‘None’, mod]