Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random slideshow and the ability to randomly display all resources #153

Closed
RouHim opened this issue Dec 17, 2024 Discussed in #152 · 6 comments · Fixed by #154
Closed

Random slideshow and the ability to randomly display all resources #153

RouHim opened this issue Dec 17, 2024 Discussed in #152 · 6 comments · Fixed by #154
Assignees
Labels
enhancement New feature or request

Comments

@RouHim
Copy link
Owner

RouHim commented Dec 17, 2024

Discussed in #152

Originally posted by joe128 December 17, 2024

Problem

If the config RANDOM_SLIDESHOW is enabled, a random image is fetched for each slideshowTick. So there is a very high chance that an image will be displayed twice before all resources have been displayed.
This behaviour isn't suitable if you want to display a slideshow over a small number of images.
(I have mentioned this issue and my usecase under #138 (comment))

Solution

Perhaps we could introduce a config that allows a kind of "shuffle and display all resources" (SHUFFLE_ALL)?
Another possibilities

  • refactor the existing config RANDOM_SLIDESHOW
  • introduce a config SHOW_ALL (with optional RANDOM_SLIDESHOW)

I have already implemented a POC and tested it with a small set of images.

Minimal config example to reproduce:

rm -rf testresources \
  && mkdir testresources \
  && rm -rf devdatafolder \
  && mkdir devdatafolder \
  && wget -O testresources/pic1.jpg https://picsum.photos/500/500 \
  && wget -O testresources/pic2.jpg https://picsum.photos/500/500 \
  && RESOURCE_PATHS=testresources DATA_FOLDER=devdatafolder RANDOM_SLIDESHOW=true SLIDESHOW_INTERVAL=3 ./this-week-in-past
@RouHim RouHim added the enhancement New feature or request label Dec 17, 2024
@RouHim RouHim self-assigned this Dec 17, 2024
@RouHim
Copy link
Owner Author

RouHim commented Dec 25, 2024

RANDOM_SLIDESHOW now plays an actually shuffled slideshow.

@joe128
Copy link

joe128 commented Dec 28, 2024

Thanks a lot, but why the limitation to 1000 images? I think it should be at least 10.000.
Unfortunately, during the Christmas holidays I discovered the next missing feature: Display all images chronologically. Last week I described a solution in discussion #152 with a SHOW_ALL parameter, perhaps this approach can also be considered?

@RouHim
Copy link
Owner Author

RouHim commented Dec 28, 2024

There should be definitely a limitation, which value do you think could be a good idea?

@RouHim
Copy link
Owner Author

RouHim commented Dec 28, 2024

If you have the time, you could raise a feature request for your chronological sorting feature.

@RouHim
Copy link
Owner Author

RouHim commented Dec 29, 2024

@joe128

There should be definitely a limitation, which value do you think could be a good idea?

1000 should be more than fine, because after the default refresh interval, which is 1 hour per default, and a default slideshow interval of 30 seconds, we just need 120 images right?

But this should not be hardcoded, thus it should be calculated by this formula:
(60/SLIDESHOW_INTERVAL)*REFRESH_INTERVAL
Optional: * 10% buffer

Related PR: #155

@joe128
Copy link

joe128 commented Dec 31, 2024

I think this approach works well, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants