koel/app/Services/Streamer/Adapters/SftpStreamerAdapter.php
2024-07-06 17:45:02 +02:00

21 lines
490 B
PHP

<?php
namespace App\Services\Streamer\Adapters;
use App\Models\Song;
use App\Services\SongStorages\SftpStorage;
use App\Services\Streamer\Adapters\Concerns\StreamsLocalPath;
class SftpStreamerAdapter implements StreamerAdapter
{
use StreamsLocalPath;
public function __construct(private readonly SftpStorage $storage)
{
}
public function stream(Song $song, array $config = []): void
{
$this->streamLocalPath($this->storage->copyToLocal($song));
}
}