mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-21 01:05:30 +00:00
channels supports stream_profile_id on return response, epg grid supports full day of programming
This commit is contained in:
parent
5dc4e54585
commit
b2c323d61d
2 changed files with 11 additions and 2 deletions
|
|
@ -66,6 +66,13 @@ class ChannelSerializer(serializers.ModelSerializer):
|
|||
required=False
|
||||
)
|
||||
|
||||
stream_profile_id = serializers.PrimaryKeyRelatedField(
|
||||
queryset=StreamProfile.objects.all(),
|
||||
source='stream_profile',
|
||||
allow_null=True,
|
||||
required=False
|
||||
)
|
||||
|
||||
# Possibly show streams inline, or just by ID
|
||||
# streams = StreamSerializer(many=True, read_only=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -50,8 +50,10 @@ class EPGGridAPIView(APIView):
|
|||
responses={200: ProgramDataSerializer(many=True)}
|
||||
)
|
||||
def get(self, request, format=None):
|
||||
now = timezone.now()
|
||||
twelve_hours_later = now + timedelta(hours=12)
|
||||
# Get current date and reset time to midnight (00:00)
|
||||
now = timezone.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
||||
twelve_hours_later = now + timedelta(hours=24)
|
||||
logger.debug(f"EPGGridAPIView: Querying programs between {now} and {twelve_hours_later}.")
|
||||
# Use select_related to prefetch EPGData and Channel data
|
||||
programs = ProgramData.objects.select_related('epg__channel').filter(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue