Rules can be limited to schedule blocks

Each rule has the blocks it acts in (none: always; without a running
schedule always). Stored as a block mask (schedule format 2, version 1
records are converted), in JSON as the blocks' start times. Version 2.7.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-15 22:25:00 +02:00
1 parent 87e242bf89
commit 53e9057d02
11 files changed
+166 -19

No files matched your search

+4 -3
View File
@@ -104,8 +104,9 @@ PageChoice PageSelector::update(int minute, uint32_t now)
const TriggerRule &r = _schedule->rules[i];
if (r.mode == TriggerMode::ForSeconds && _rule_timer[i] && now - _rule_since[i] >= r.seconds * 1000UL)
_rule_timer[i] = false;
bool takes_over = (r.mode == TriggerMode::WhileTrue && _rule_active[i]) ||
(r.mode == TriggerMode::ForSeconds && _rule_timer[i]);
bool takes_over = ((r.mode == TriggerMode::WhileTrue && _rule_active[i]) ||
(r.mode == TriggerMode::ForSeconds && _rule_timer[i])) &&
ruleInBlock(r, _block);
if (takes_over)
{
choice.page = r.page;
@@ -137,7 +138,7 @@ PageChoice PageSelector::update(int minute, uint32_t now)
for (int i = 0; i < rule_count; i++)
{
const TriggerRule &r = _schedule->rules[i];
if (r.mode == TriggerMode::AddToRotation && _rule_active[i])
if (r.mode == TriggerMode::AddToRotation && _rule_active[i] && ruleInBlock(r, _block))
items[count++] = {r.page, r.seconds * 1000UL, ShowReason::Rotation, i};
}