this post was submitted on 28 Jul 2023
1 points (100.0% liked)

Selfhosted

39964 readers
378 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

So here's my situation. I've been looking for a long time for a self-hosted photo library. I have pretty low requirements: I just want it to be able to show the videos and images I have stored on my NAS in a random order, and to support a slideshow of those files, also in a random order.

I thought I had finally found what I was looking for with PiGallery2 -- it supports a hidden file that triggers the random order sorting -- but it's not stable. It works for a while and then takes ages and ages to refresh the album.

Synology Photos would have been perfect, but it can't randomize!

Any suggestions? I'm looking to host this on Debian.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

Solving it the unix way:

ls -1 | sort -R | sxiv -f -s f -S 5 -

So it's ls -1 to list the content of current directory (presumably where your pictures are), with one file per line, so we can then pipe it to sort, with the -R option to sort randomly, then piping the result to sxiv, a lightweight image viewer available on most distro (I just checked, it's available on Debian). For its options : -f means it's fullscreen, -s f makes it scale to fit the image on screen as well as possible, -S 5 tells it to start in slideshow mode and change picture every 5 seconds, and - is to tell it to take the files list from stdin (thus from the ls and sort commands).

This won't work for videos, though, only pictures.