Skip to content

Commit 4fdc571

Browse files
committed
chore: Fix not passing query params to stop the oldest stream for single connection limit
1 parent b2108bd commit 4fdc571

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/Services/M3uProxyService.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ public static function stopOldestPlaylistStream(string $playlistUuid, ?int $excl
473473
}
474474

475475
try {
476-
$endpoint = $service->apiBaseUrl.'/streams/oldest-by-metadata';
476+
// Build query parameters for DELETE request
477477
$params = [
478478
'field' => 'playlist_uuid',
479479
'value' => $playlistUuid,
@@ -483,11 +483,15 @@ public static function stopOldestPlaylistStream(string $playlistUuid, ?int $excl
483483
$params['exclude_channel_id'] = (string) $excludeChannelId;
484484
}
485485

486+
// Laravel's Http::delete() doesn't support query params as second argument
487+
// We need to append them to the URL
488+
$endpoint = $service->apiBaseUrl.'/streams/oldest-by-metadata?'.http_build_query($params);
489+
486490
$response = Http::timeout(5)->acceptJson()
487491
->withHeaders($service->apiToken ? [
488492
'X-API-Token' => $service->apiToken,
489493
] : [])
490-
->delete($endpoint, $params);
494+
->delete($endpoint);
491495

492496
if ($response->successful()) {
493497
$data = $response->json();

0 commit comments

Comments
 (0)