The code used to bounce the stream at midday, but then later got changed so it bounced the stream whenever the current "segment" exceeded a certain maximum length. (With the max length being configurable, at the time of this writing I had it configured to 7.6 hours, 27600 seconds.)
Change it to:
Look at the preset configured max length.
Calculate the midday point (seconds since sunrise).
Whichever is the shorter value is the one you use for the baseline max length.
Desired/expected behavior from this:
Shorter day lengths (winter days) will get split down the middle so you don't have lopsided morning/evening shift lengths on the archives.
Longer day lengths (summer days) will get split at the max length point. If the day length is long enough, you might still get three segments.
Make sure that:
If the times change during the middle of the day (the sunrise/sunset values change during the internet query for said values, perhaps because of a DST flip maybe), then it should not bounce twice during that day.
The code used to bounce the stream at midday, but then later got changed so it bounced the stream whenever the current "segment" exceeded a certain maximum length. (With the max length being configurable, at the time of this writing I had it configured to 7.6 hours, 27600 seconds.)
Change it to:
Desired/expected behavior from this:
Make sure that: