Explorer
/proc/3/root/tmp/patch_days0.py
← Zurück ↓ Download
from pathlib import Path
p=Path('/opt/struktur/social-media-agent/app.py')
s=p.read_text()
old='''        else:\n            date_clause = "AND datetime(published_at) IS NOT NULL AND datetime(published_at) >= datetime(?)"\n            date_params = [cutoff]\n'''
new='''        elif days <= 0:\n            # ALLE is genuinely unbounded; unknown publication dates are\n            # allowed only in this explicit all-time view. Time filters below\n            # remain strict and never fall back to observed_at.\n            date_clause = ""\n            date_params = []\n        else:\n            date_clause = "AND datetime(published_at) IS NOT NULL AND datetime(published_at) >= datetime(?)"\n            date_params = [cutoff]\n'''
if old not in s: raise SystemExit('days anchor not found')
p.write_text(s.replace(old,new,1))