This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Pages: 1 - Last Post: 24 Jun 26, 22:49 Last Post By: davidekholm Threads: [ Previous | Next ]
HPSmallegoor

Posts: 31
Registered: 8-Dec-2019
Randomize folder thumbnails
Posted: 19 Jun 26, 14:26
 
  Click to reply to this thread Reply
My website contains tens of thousands of images, from which I have manually selected a thumbnail for each folder. This means that, unless I adjust everything manually, the website will look increasingly static.

I have created a script in PowerShell that can manipulate the meta.properties files in such a way that random files or folders are written. This results in a completely new look for my website every time I run a generation.

Would it be an idea to build this into jAlbum, but more intelligently with certain choices or exceptions? I am quite enthusiastic about the result, and perhaps others are interested in it as well.
MarkusD

Posts: 903
Registered: 13-Apr-2006
Re: Randomize folder thumbnails
Posted: 19 Jun 26, 14:39   in response to: HPSmallegoor in response to: HPSmallegoor
 
  Click to reply to this thread Reply
HPSmallegoor wrote:
I have created a script in PowerShell that can manipulate the meta.properties files in such a way that random files or folders are written. This results in a completely new look for my website every time I run a generation.
This would be a desaster for me. The selected thumbnail for the folder is a once very well choosen picture. Changing it randomly, again, a desaster!

I have also hundrets of videos, which „thumb“ should be used if randomly a video delivers the thumb?

No, thanks, I don't see any sense in such a function for me. But, don't get me wrong, this might be interesting for others.
RobM

Posts: 4,038
Registered: 4-Aug-2006
Re: Randomize folder thumbnails
Posted: 19 Jun 26, 18:48   in response to: HPSmallegoor in response to: HPSmallegoor
 
  Click to reply to this thread Reply
First, manipulation of jAlbum hidden text files is not recommended.

An alternative approach would be to have a template page as your home page and thumbnails for each day of the month, or a ‘Page of the day’.

You could then change just the thumbnails for the thumbnails per month page. For the page of the day idea you could select a random image from the album.
davidekholm

Posts: 3,990
Registered: 18-Oct-2002
Re: Randomize folder thumbnails
Posted: 24 Jun 26, 22:46   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
What skin are you using? A skin could pick a random image for you using javascript for instance.

Otherwise, you can randomise images in jAlbum by right-clicking a folder and selecting Order by->Shuffle.

To randomize all representing images for all sub folders, run this script in jAlbum's system console (F7). It's platform neutral as well, and won't break if we update jAlbum's underlying files: (Groovy mode)

import java.util.concurrent.ThreadLocalRandom;
rootFolder.descendants.filter(ao -> ao.folder).forEach(folder -> {
  folder.representingAlbumObject = folder.children[ThreadLocalRandom.current().nextInt(folder.children.size())]
})


To save this script, save it as "Randomize representing images.groovy" to <config>/tools/, where "<config>" is jAlbum's config folder (Tools->Open directories->Config directory).
After a restart, you can now access this tool via jAlbum's Tools menu at any time.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums