Ensure cache directory exists before saving EPG data

This commit is contained in:
SergeantPanda 2025-04-30 17:54:48 -05:00
parent c058c4ed10
commit 6adda8209f

View file

@ -38,6 +38,10 @@ class EPGSource(models.Model):
# Build full path in MEDIA_ROOT/cached_epg
cache_dir = os.path.join(settings.MEDIA_ROOT, "cached_epg")
# Create directory if it doesn't exist
os.makedirs(cache_dir, exist_ok=True)
cache = os.path.join(cache_dir, filename)
return cache