Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
amwpsaa
Experienced
Topic Author
Posts: 53
Joined: 29 Jul 2021, 08:46

Folders can display thumbnails and display the number of files.

15 Oct 2021, 21:29

Does the new version have this function?Folders can display thumbnails and display the number of files.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Folders can display thumbnails and display the number of files.  Topic is solved

15 Oct 2021, 23:31

amwpsaa wrote:Does the new version have this function?Folders can display thumbnails and display the number of files.
Thumbnails yes. Number of files no ... I will need to think about that after this release.
Image
 
User avatar
amwpsaa
Experienced
Topic Author
Posts: 53
Joined: 29 Jul 2021, 08:46

Re: Folders can display thumbnails and display the number of files.

16 Oct 2021, 13:05

Use json to record, enter for the first time, or detect a change in the number of files, update the json file
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Folders can display thumbnails and display the number of files.

17 Oct 2021, 02:14

amwpsaa wrote:Use json to record, enter for the first time, or detect a change in the number of files, update the json file
I will definitely add it as an option, but it's a bit more complicated than you think if you want optimal performance. I'll explain (although you don't necessarily need to understand it).

When Files app reads a folder, it just reads the content inside the folder and that's it. Simple. If that folder has 100 subfolders and you want to get the "number of files" inside every subfolder, Files app will need to scan all files inside all subfolders ... As you can imagine, that can be a heavy process if there are 100+ subfolders to scan. What about cache (json)? That would have helped, but how do we know the cache is fresh and the "number of files" for all subfolders is correct and updated? At best, that means the cache would have to refresh every time the content of a subfolder changes, and that itself needs to be detected. So unfortunately, there is no elegant way to achieve "number of files" inside a folder if you want to maintain optimal performance and useful caching.

Having said that, the process would in most cases be quite fast (more than fast enough) unless your server is slow. We might be talking about folder processing times going from 10 ms to 100 ms. 10 X slower, but mostly unnoticeable to humans :thumbsup:

This was easier with folder preview images, because the create and cache logic is managed separately from the folder.