Return a lightweight list of channels with only the fields needed by the TV Guide. The TV Guide is a downstream output surface like HDHR / M3U / EPG / XC and must reflect the user's overrides. Effective values are coalesced at the SQL layer; the annotated columns are renamed
(self, request, *args, **kwargs)
| 1623 | |
| 1624 | @action(detail=False, methods=["get"], url_path="summary") |
| 1625 | def summary(self, request, *args, **kwargs): |
| 1626 | """Return a lightweight list of channels with only the fields needed by the TV Guide. |
| 1627 | |
| 1628 | The TV Guide is a downstream output surface like HDHR / M3U / EPG / |
| 1629 | XC and must reflect the user's overrides. Effective values are |
| 1630 | coalesced at the SQL layer; the annotated columns are renamed |
| 1631 | back to the raw field names on the way out so the response |
| 1632 | shape stays unchanged for the frontend. |
| 1633 | """ |
| 1634 | from .managers import with_effective_values |
| 1635 | |
| 1636 | queryset = with_effective_values( |
| 1637 | self.filter_queryset(self.get_queryset()) |
| 1638 | ) |
| 1639 | return JsonResponse( |
| 1640 | [ |
| 1641 | { |
| 1642 | "id": row["id"], |
| 1643 | "uuid": row["uuid"], |
| 1644 | "name": row["effective_name"], |
| 1645 | "logo_id": row["effective_logo_id"], |
| 1646 | "channel_number": row["effective_channel_number"], |
| 1647 | "epg_data_id": row["effective_epg_data_id"], |
| 1648 | "channel_group_id": row["effective_channel_group_id"], |
| 1649 | } |
| 1650 | for row in queryset.values( |
| 1651 | "id", |
| 1652 | "uuid", |
| 1653 | "effective_name", |
| 1654 | "effective_logo_id", |
| 1655 | "effective_channel_number", |
| 1656 | "effective_epg_data_id", |
| 1657 | "effective_channel_group_id", |
| 1658 | ) |
| 1659 | ], |
| 1660 | safe=False, |
| 1661 | ) |
| 1662 | |
| 1663 | @extend_schema( |
| 1664 | parameters=[ |
nothing calls this directly
no test coverage detected