mirror of
https://github.com/koel/koel
synced 2024-11-10 14:44:13 +00:00
Fix tests
This commit is contained in:
parent
4ad5020b58
commit
f472ff9ac8
2 changed files with 9 additions and 5 deletions
|
@ -212,15 +212,17 @@ class Album extends Model
|
|||
*/
|
||||
public function getHasCoverAttribute()
|
||||
{
|
||||
if (!$this->attributes['cover']) {
|
||||
$cover = array_get($this->attributes, 'cover');
|
||||
|
||||
if (!$cover) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->attributes['cover'] === self::UNKNOWN_COVER) {
|
||||
if ($cover === self::UNKNOWN_COVER) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return file_exists(public_path("/public/img/covers/{$this->attributes['cover']}"));
|
||||
return file_exists(public_path("/public/img/covers/$cover"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -188,11 +188,13 @@ class Artist extends Model
|
|||
|
||||
public function getHasImageAttribute()
|
||||
{
|
||||
if (!$this->attributes['image']) {
|
||||
$image = array_get($this->attributes, 'image');
|
||||
|
||||
if (!$image) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!file_exists(public_path("public/img/artists/{$this->attributes['image']}"))) {
|
||||
if (!file_exists(public_path("public/img/artists/$image"))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue