mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 07:27:47 +00:00
feat: proxy feature skipped when playlist is active
This commit is contained in:
parent
c8b21acb36
commit
6b40a2b836
1 changed files with 57 additions and 53 deletions
|
|
@ -22,6 +22,7 @@ class FetchProxyCloudResponses implements ShouldQueue
|
||||||
public function handle(): void
|
public function handle(): void
|
||||||
{
|
{
|
||||||
Device::where('proxy_cloud', true)->each(function ($device) {
|
Device::where('proxy_cloud', true)->each(function ($device) {
|
||||||
|
if (!$device->getNextPlaylistItem()) {
|
||||||
try {
|
try {
|
||||||
$response = Http::withHeaders([
|
$response = Http::withHeaders([
|
||||||
'id' => $device->mac_address,
|
'id' => $device->mac_address,
|
||||||
|
|
@ -90,6 +91,9 @@ class FetchProxyCloudResponses implements ShouldQueue
|
||||||
'error' => $e->getMessage(),
|
'error' => $e->getMessage(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Log::info("Skipping device: {$device->mac_address} as it has a pending playlist item.");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue