Page 1 of 1

Hope to add folder thumbnails, this is a very good idea

Posted: 01 Aug 2021, 00:52
by amwpsaa
Use the first internal picture as the thumbnail, if it is a video, use the video cover, if there is no picture, use the default picture as the thumbnail.

This will be very popular.


QQ截图20210801124709.jpg
QQ截图20210801124709.jpg (13.39 KiB) Viewed 25572 times
[/font][/size][/color]

Re: Hope to add folder thumbnails, this is a very good idea  Topic is solved

Posted: 01 Aug 2021, 01:17
by mjau-mjau
amwpsaa wrote:Use the first internal picture as the thumbnail, if it is a video, use the video cover, if there is no picture, use the default picture as the thumbnail.
Yes :thumbsup: There is one huge challenge with this though:

1. You click a folder, request is sent to server/PHP.
2. PHP will read/loop all files in the specific folder and return data to the application.
3. Now, if you want to include "thumbnails" for all subfolders of a folder, Files app will need to also search files inside each subfolder.

Instead of reading files inside a single folder, the process therefore requires reading files inside the specified folder AND all subfolders. If the folder contains 10 subfolders, it means 11 folders need to be processed instead of just one. This might not be slow (depends on server and content), but it certainly may affect the speed of Files app when clicking folders. The cache (stored inside _files/cache) will speed things up, but it won't help the first request when a folder gets processed. Also, it's more difficult to implement into Files app fast cache mechanism, which checks the folder "modified date" to check if cache is valid. If we need to validate if thumbnails for subfolders are valid, we would need to check "modified date" of all subfolders and include in cache validation for a single folder.

All in all, it can definitely be done, and it would definitely be cool. But if you are conserned by speed of the application, then it will have consequences. If it gets added, it will definitely be a config option, likely disabled by default.

Re: Hope to add folder thumbnails, this is a very good idea

Posted: 02 Aug 2021, 00:00
by DinGood
I once had this idea. I made an immature suggestion. Of course, I'm not a programmer.

Looking at the author's reply, it seems that it is difficult to cycle the files in the folder. If a folder only uses the fixed file name as the thumbnail, such as the picture thumbnail.jpg in the folder as the cover?

Re: Hope to add folder thumbnails, this is a very good idea

Posted: 02 Aug 2021, 01:06
by mjau-mjau
DinGood wrote:If a folder only uses the fixed file name as the thumbnail, such as the picture thumbnail.jpg in the folder as the cover?
That's a good idea! We still need to check that the preview image exists, but it will be fast.
DinGood wrote:Looking at the author's reply, it seems that it is difficult to cycle the files in the folder.
It's not really "difficult" and it won't be "slow", but it will be slow compared to how fast it is now.

The biggest challenge is how to incorporate into the cache mechanism (folder modified date), which does not detect changes inside subfolders. You can disable cache, but then every folder click/load will need to reload and re-process all data. Again, this is not slow (depending on server and folder sizer), but it will be slow compared to the fast cache mechanism.

I will think about it. Definitely would be nice with folder preview images!

Re: Hope to add folder thumbnails, this is a very good idea

Posted: 09 Nov 2021, 01:04
by mjau-mjau
Files app 0.3.0 now includes folder preview images, see demo.
Image