mirror of
https://github.com/koel/koel
synced 2025-01-04 16:58:49 +00:00
29 lines
606 B
PHP
29 lines
606 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Repositories;
|
||
|
|
||
|
use App\Models\Song;
|
||
|
use App\Services\HelperService;
|
||
|
use Illuminate\Contracts\Auth\Guard;
|
||
|
|
||
|
class SongRepository extends AbstractRepository
|
||
|
{
|
||
|
private $helperService;
|
||
|
|
||
|
public function __construct(Guard $auth, HelperService $helperService)
|
||
|
{
|
||
|
parent::__construct($auth);
|
||
|
$this->helperService = $helperService;
|
||
|
}
|
||
|
|
||
|
public function getModelClass(): string
|
||
|
{
|
||
|
return Song::class;
|
||
|
}
|
||
|
|
||
|
public function getOneByPath(string $path): ?Song
|
||
|
{
|
||
|
return $this->getOneById($this->helperService->getFileHash($path));
|
||
|
}
|
||
|
}
|