Skip to content
Snippets Groups Projects
Commit 435f2f8d authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

feat: add playlist_id to serialized basic program entry

parent 4dbed416
No related branches found
No related tags found
1 merge request!52new program endpoint
Pipeline #8321 failed
......@@ -699,3 +699,9 @@ class ProgramEntry:
end: datetime.datetime
show: Show
timeslot: TimeSlot | None
def playlist_id(self) -> int | None:
if self.timeslot and self.timeslot.playlist_id:
return self.timeslot.playlist_id
else:
return self.show.default_playlist_id
......@@ -1293,6 +1293,7 @@ class BasicProgramEntrySerializer(serializers.Serializer):
start = serializers.DateTimeField()
end = serializers.DateTimeField()
timeslot_id = serializers.IntegerField(allow_null=True, source="timeslot.id")
playlist_id = serializers.IntegerField(allow_null=True)
show_id = serializers.IntegerField(source="show.id")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment