| 574 | ) |
| 575 | @action(detail=False, methods=["post"], url_path="by-ids") |
| 576 | def get_by_ids(self, request, *args, **kwargs): |
| 577 | ids = request.data.get("ids", []) |
| 578 | if not isinstance(ids, list): |
| 579 | return Response( |
| 580 | {"error": "ids must be a list of integers"}, |
| 581 | status=status.HTTP_400_BAD_REQUEST, |
| 582 | ) |
| 583 | |
| 584 | streams = Stream.objects.filter(id__in=ids) |
| 585 | serializer = self.get_serializer(streams, many=True) |
| 586 | return Response(serializer.data) |
| 587 | |
| 588 | |
| 589 | # ───────────────────────────────────────────────────────── |