mirror of
https://github.com/koel/koel
synced 2024-11-24 13:13:05 +00:00
7ba295efad
* Use ADMIN_* variables if available to create the admin account * Add APP_MEDIA_PATH for media directory * Use the standard --no-interaction flag to koel:init * Undo variable aligment and code formatting * Prefer early return over else, add new line before return statements * Some fixes
28 lines
588 B
PHP
28 lines
588 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(HelperService $helperService)
|
|
{
|
|
parent::__construct();
|
|
$this->helperService = $helperService;
|
|
}
|
|
|
|
public function getModelClass(): string
|
|
{
|
|
return Song::class;
|
|
}
|
|
|
|
public function getOneByPath(string $path): ?Song
|
|
{
|
|
return $this->getOneById($this->helperService->getFileHash($path));
|
|
}
|
|
}
|