perf(epg): defer loading of programme_index in EPGSourceViewSet for performance improvement

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
SergeantPanda 2026-04-24 10:01:23 -05:00 committed by Five Boroughs
parent 690fa10be4
commit 1e9fd28653
No known key found for this signature in database

View file

@ -54,6 +54,8 @@ class EPGSourceViewSet(viewsets.ModelViewSet):
from apps.channels.models import Channel
return EPGSource.objects.select_related(
"refresh_task__crontab", "refresh_task__interval"
).defer(
'programme_index'
).annotate(
has_channels=Exists(
Channel.objects.filter(epg_data__epg_source_id=OuterRef('pk'))