Remember calculated Folder Size within the session.

Features wanted...
OfficialBispo
Posts: 5
Joined: 06 Jul 2019 20:43

Re: Remember calculated Folder Size within the session.

Post by OfficialBispo »

admin wrote: 07 Nov 2021 16:58 Or call it "Calculate Folder Sizes Now" and enable it only when the cache is enabled?
That makes more sense, I don't think it should be a need to calculate folder sizes if you're not using them right now.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

Here is another, more radical idea. Go back to the old functionality (always fresh values) and name (View | Calculate Folder Sizes). And add a tweak to let it use any cached values (and make it necessary to click "Refresh Folder Sizes" if needed).

Bonus: The documentation, translation, help strings, icon ... all don't have to be updated. And years of related forum posts continue to make sense.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

Done.

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Remember calculated Folder Size within the session.

Post by Evolve »

I keep struggling with one particular scenario where I need to calculate the sizes of n specific folders and I need this info to survive a tab switch.
Currently When Cache Folder Sizes is enabled, it first looks in the cache and if there is no info it starts auto-calculation.
Would it be possible to add an option to stop Always Show Folder Sizes from auto calculating sizes and to only show what's already in the cache?
ACFS.png
ACFS.png (6.44 KiB) Viewed 1095 times
Here is the behavior I need:
0. It shows nothing because the cache is empty
1. I manually calculate folders 3 and 6
2. I switch to another tab and then back
3. It grabs the info for 3 and 6 from the cache
4. It does not auto-calculate sizes for folders 1,2,4,5,7,8,...
Result.png
Result.png (9.39 KiB) Viewed 1095 times

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

Actually not a bad idea. I'll add a tweak for now.

Code: Select all

    + Configuration | General | Tree and List | List | Cache folder sizes: Added a tweak 
      that allows you to avoid automatic folder size calculation.
        ShowFolderSizeNoAutoCalc=1
      If set to 1 only folder sizes already present in the cache are displayed in the 
      list. You still can explicitly trigger a calculation by View | Calculate Folder 
      Sizes (Shift+F5). If successful the setting will be added to the UI later.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Remember calculated Folder Size within the session.

Post by highend »

If successful the setting will be added to the UI later.
Immediate success^^ Never used auto calculation before because I only need it for specific folders as well. Being able to change that via the gui would be the icing on the cake...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

:) Let's first see how the tweak fares.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

I think the setting should only kick in when the Folder Size Cache is enabled, otherwise auto-calc is expected.

So I will reverse its logic and rename it like this:
CachedFolderSizesAutoCalc=0

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

Changed my mind about the latter. Now I designed it analogous to Configuration | Preview | Thumbnails | Show cached thumbnails only:

Code: Select all

    + Configuration | General | Tree and List | List | Cache folder sizes: Added a tweak 
      that allows you to avoid automatic folder size calculation.
        CachedFolderSizesShowCachedOnly=1
      If set to 1 then, if "Cache folder sizes" is ON, only folder sizes already present 
      in the cache are displayed in the list, no automatic (and probably time-consuming) 
      calculation will kick in.
      Notes:
      - You still can explicitly trigger a calculation by View | Calculate Folder 
        Sizes (Shift+F5) or by "Refresh Folder Sizes" from the Size Column Context Menu.
      - If successful the setting will be added to the UI later.

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Remember calculated Folder Size within the session.

Post by Evolve »

There is a small issue: it does not re-calculate empty folders, showing nothing instead.
I personally don't have a strong opinion, but according to this, it should, I believe...

Code: Select all

v16.80.0004 - 2016-05-23 20:10
    * Folder Size Caching: From now on folders cached as "Empty" will always be 
      re-calculated when showing the folder sizes. If they are still empty the 
      costs for this are minimal, and if they are not empty anymore it's really 
      good to know. So when you see "Empty" you can pretty much rely on it since 
      the information is freshly harvested.
PS: I'm perfectly happy with either way! :party: Just letting you know.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

Evolve wrote: 22 Jul 2022 16:03 There is a small issue: it does not re-calculate empty folders, showing nothing instead.
I think it is okay like that. "Empty" from the cache is not believed, and (with the new setting) not re-calculated.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

highend wrote: 22 Jul 2022 12:15
If successful the setting will be added to the UI later.
Immediate success^^ Never used auto calculation before because I only need it for specific folders as well. Being able to change that via the gui would be the icing on the cake...
Done. :)

Am I right that this setting is a bit confusing and not really needed anymore? Actually since 20220120 it does not seem to work anymore as intended. I think it can go:

Code: Select all

v22.40.0213 - 2021-11-07 18:17
    + List | Size Column | Context Menu: Added toggle "Use Cache on Calculate 
      Folder Sizes". Tick it to make "View | Calculate Folder Sizes" pull the 
      folder size data from the cache. FYI, the INI key is CachedFolderSizesOnCalc.

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Remember calculated Folder Size within the session.

Post by Evolve »

Another confusing thing: what's the difference between these two?

Code: Select all

List | Size Column | Context Menu | Refresh Folder Sizes
View | Calculate Folder Sizes
And if there is no difference, shouldn't they both be called "Calculate Folder Sizes"?

PS: Actually they seem connected, here is my understanding:
When "Use Cache on Calculate Folder Sizes" is ticked, "Calculate Folder Sizes' does not calculate, it pulls the info from the cache instead. So in order to calculate, you have "Refresh Folder Sizes" which works like "Calculate Folder Sizes". If you get rid of "Use Cache on...", you won't need "Refresh..." anymore because "Calculate..." will always calculate.

PPS: I think if you want to keep this "pulling from cache" functionality, a better way would be adding a separate command instead of this second mode for "Calculate Folder Sizes" combined with "Refresh Folder Sizes" working as its first mode.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Remember calculated Folder Size within the session.

Post by admin »

Yes, "Use Cache on Calculate Folder Sizes" used to do that, but not anymore. It stopped working as of 20220120.

You are right, without a working "Use Cache on Calculate Folder Sizes", "Refresh Folder Sizes" is identical to "Calculate Folder Sizes" and should be called as such.

PPS: ... I'm inclined to simplify things for now and just remove the useless/confusing stuff.

Evolve
Posts: 353
Joined: 27 Feb 2020 09:48

Re: Remember calculated Folder Size within the session.

Post by Evolve »

From the Documentation:

Code: Select all

When freshly calculating a folder size not only this folder's size but also the sizes of its direct
child folders are auto-added to the cache. This allows for quickly going down to the next level,
and propagates fresh values one level down when refreshing folder sizes. Additionally any subfolders
containing more than 256 items (recursively) are auto-added to the cache.
Please add a tweak to control this number. Currently with this new setting Show cached folder sizes only ticked, it's really weird to traverse deeper through the hierarchy and see some sizes but not the others.
deep2.png
deep2.png (25.43 KiB) Viewed 646 times

Post Reply