mirror of
https://github.com/koel/koel
synced 2024-12-26 04:23:05 +00:00
26 lines
528 B
PHP
26 lines
528 B
PHP
<?php
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\Song;
|
|
use App\Repositories\Traits\Searchable;
|
|
use App\Services\HelperService;
|
|
|
|
class SongRepository extends AbstractRepository
|
|
{
|
|
use Searchable;
|
|
|
|
private $helperService;
|
|
|
|
public function __construct(HelperService $helperService)
|
|
{
|
|
parent::__construct();
|
|
|
|
$this->helperService = $helperService;
|
|
}
|
|
|
|
public function getOneByPath(string $path): ?Song
|
|
{
|
|
return $this->getOneById($this->helperService->getFileHash($path));
|
|
}
|
|
}
|