koel/app/Services/Streamer/Adapters/SftpStreamerAdapter.php

22 lines
490 B
PHP
Raw Normal View History

2024-04-26 13:35:26 +00:00
<?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));
}
}