Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show storage space occupied by each page? #248

Closed
andyylin opened this issue Aug 11, 2021 · 7 comments · Fixed by #249
Closed

Show storage space occupied by each page? #248

andyylin opened this issue Aug 11, 2021 · 7 comments · Fixed by #249
Assignees
Labels
feature-request New feature or request released Available in a released installer reopen More to do?

Comments

@andyylin
Copy link
Sponsor

Some of my sections are huge, based on the size of the backup .one file. But it's hard to determine what exactly is taking up space (usually photos since they're inserted into OneNote at full resolution).

Is it possible to analyze a OneNote section and determine which pages or even elements are taking up space?

At the moment, I can only go one by one through each photo and either use OneMore's Resize feature to check the resolution and file size, or else use OneNote's built in "Restore to original size" to check if the image is too large.

Maybe a possible output is a new page with a list of the pages in the section and the storage space occupied by each page.

@stevencohn stevencohn added the feature-request New feature or request label Aug 11, 2021
@stevencohn stevencohn self-assigned this Aug 18, 2021
@stevencohn stevencohn added the released Available in a released installer label Aug 18, 2021
@andyylin
Copy link
Sponsor Author

andyylin commented Aug 19, 2021

Saw the release, thanks for this.

Seems to have a bug: I don't have backups set up but I ran this with check backups enabled, and it threw me an error.

image

Here are the log contents:


9920:9] Running command AnalyzeCommand
9920:9] Error running command AnalyzeCommand
9920:9] System.IO.DirectoryNotFoundException
Message: Could not find a part of the path 'C:\Users\XXX\AppData\Local\Microsoft\OneNote\16.0\Backup\Personal (Web)'.
Source: mscorlib
StackTrace:    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.EnumerateFiles(String path, String searchPattern)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.ReportSections(Table table, XElement folder, String folderPath)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.ReportSections(XElement container, XElement notebooks)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.<Execute>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at River.OneMoreAddIn.CommandFactory.<Run>d__6.MoveNext()
TargetSite: [mscorlib] System.IO.__Error::WinIOError()

Unchecking the two checkboxes lets the macro start running, but still throws up an error:


9920:9] Running command AnalyzeCommand
9920:9] Error running command AnalyzeCommand
9920:9] System.UriFormatException
Message: Invalid URI: The format of the URI could not be determined.
Source: System
StackTrace:    at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.ReportPage(Table table, String pageId)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.ReportPages(XElement container, XElement section, String folderPath, String skipId)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.ReportAllPages(XElement container, XElement folder, String folderPath, String skipId)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.ReportAllPages(XElement container, XElement folder, String folderPath, String skipId)
   at River.OneMoreAddIn.Commands.AnalyzeCommand.<Execute>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at River.OneMoreAddIn.CommandFactory.<Run>d__6.MoveNext()
TargetSite: [System] System.Uri::CreateThis()

@stevencohn
Copy link
Owner

Fix 3.29.1 released

@stevencohn stevencohn linked a pull request Aug 19, 2021 that will close this issue
@andyylin
Copy link
Sponsor Author

The macro runs and finishes now. The result page looks quite nice!

However, I'm seeing an issue where the Section summary is formatted but doesn't show data. Attaching an example screenshot.

image

@stevencohn
Copy link
Owner

As mentioned in the Wiki, this relies on at least one local backup to be previously run. If those backup files do not exist then this table will be blank. You can manually run a backup from the OneNote Options dialog. Under Save and Backup click Backup all notebooks now.

@andyylin
Copy link
Sponsor Author

As mentioned in the Wiki, this relies on at least one local backup to be previously run. If those backup files do not exist then this table will be blank. You can manually run a backup from the OneNote Options dialog. Under Save and Backup click Backup all notebooks now.

Backups are enabled and it looks like the Summary calculates things just fine.

image

It's the Sections part that is showing up empty.

Is it maybe because of the Chinese characters in the file system? I tried to click the generated link to the backup folder and got an error. Manually navigating to the backup folder works fine.

image

image

@stevencohn
Copy link
Owner

It's possible it's the Chinese characters. I'll see if I can emulate that on my English machine (it's impossible for me to debug this on a Chinese machine, sorry I don't read Chinese!)

@andyylin
Copy link
Sponsor Author

andyylin commented Apr 28, 2022

Any hope of getting this fixed? Perhaps there's someone with additional Unicode experience and a Chinese machine that can help?

@stevencohn stevencohn reopened this Apr 28, 2022
@stevencohn stevencohn added question Further information is requested reopen More to do? and removed question Further information is requested labels Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request released Available in a released installer reopen More to do?
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants