MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / get_serializer_context

Method get_serializer_context

apps/channels/api_views.py:987–1001  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

985 return qs
986
987 def get_serializer_context(self):
988 context = super().get_serializer_context()
989 include_streams = (
990 self.request.query_params.get("include_streams", "false") == "true"
991 )
992 context["include_streams"] = include_streams
993 # source_stream is only needed by the channel edit form. For get_ids
994 # and summary the channelstream_set prefetch is skipped entirely, so
995 # source_stream cannot be computed without hitting the DB per channel.
996 # For list and write/retrieve paths the prefetch is present, so we
997 # can populate it from memory without extra queries.
998 context["include_source_stream"] = action not in (
999 "get_ids", "summary"
1000 ) if (action := getattr(self, "action", None)) else False
1001 return context
1002
1003 @extend_schema(
1004 methods=["PATCH"],

Callers 3

edit_bulkMethod · 0.95
listMethod · 0.45
listMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected