mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-17 16:50:53 +00:00
feat: Refactor DVR pre/post offset retrieval to avoid redundancy in series rule evaluation
This commit is contained in:
parent
e6c580c9bd
commit
8f97688bb1
1 changed files with 9 additions and 10 deletions
|
|
@ -1136,6 +1136,15 @@ def _evaluate_series_rules_locked(tvg_id, result):
|
|||
now = timezone.now()
|
||||
horizon = now + timedelta(days=7)
|
||||
|
||||
try:
|
||||
pre_min = int(CoreSettings.get_dvr_pre_offset_minutes())
|
||||
except Exception:
|
||||
pre_min = 0
|
||||
try:
|
||||
post_min = int(CoreSettings.get_dvr_post_offset_minutes())
|
||||
except Exception:
|
||||
post_min = 0
|
||||
|
||||
# Preload existing recordings keyed by stable program attributes that
|
||||
# survive EPG refreshes (tvg_id + original start/end times stored in
|
||||
# custom_properties). ProgramData.id changes on every EPG refresh so
|
||||
|
|
@ -1309,16 +1318,6 @@ def _evaluate_series_rules_locked(tvg_id, result):
|
|||
except Exception:
|
||||
continue # already scheduled/recorded
|
||||
|
||||
# Apply global DVR pre/post offsets (in minutes)
|
||||
try:
|
||||
pre_min = int(CoreSettings.get_dvr_pre_offset_minutes())
|
||||
except Exception:
|
||||
pre_min = 0
|
||||
try:
|
||||
post_min = int(CoreSettings.get_dvr_post_offset_minutes())
|
||||
except Exception:
|
||||
post_min = 0
|
||||
|
||||
adj_start = prog.start_time
|
||||
adj_end = prog.end_time
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue