mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-30 15:57:46 +02:00
Merge pull request #89 from Poniverse/scrutinizer-patch-1
Scrutinizer Auto-Fixes
This commit is contained in:
commit
b334e51928
43 changed files with 165 additions and 164 deletions
|
@ -27,7 +27,6 @@ use Poniverse\Ponyfm\Models\Image;
|
|||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\TrackType;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Auth;
|
||||
use DB;
|
||||
|
||||
class EditTrackCommand extends CommandBase
|
||||
|
|
|
@ -30,7 +30,6 @@ use AudioCache;
|
|||
use File;
|
||||
use Illuminate\Support\Str;
|
||||
use SplFileInfo;
|
||||
use Validator;
|
||||
|
||||
/**
|
||||
* This command is the "second phase" of the upload process - once metadata has
|
||||
|
|
|
@ -119,7 +119,7 @@ class ParseTrackTagsCommand extends CommandBase
|
|||
*
|
||||
* @param int $artistId
|
||||
* @param string|null $albumName
|
||||
* @param null $coverId
|
||||
* @param integer|null $coverId
|
||||
* @return int|null
|
||||
*/
|
||||
protected function getAlbumId(int $artistId, $albumName, $coverId = null) {
|
||||
|
|
|
@ -26,7 +26,6 @@ use Poniverse\Ponyfm\Models\Album;
|
|||
use Poniverse\Ponyfm\Models\Playlist;
|
||||
use Poniverse\Ponyfm\Models\Track;
|
||||
use Poniverse\Ponyfm\Models\User;
|
||||
use Symfony\Component\Console\Helper\ProgressBar;
|
||||
|
||||
class RebuildSearchIndex extends Command
|
||||
{
|
||||
|
|
|
@ -99,11 +99,13 @@ class TracksController extends ApiControllerBase
|
|||
return $this->notFound('Track not found!');
|
||||
}
|
||||
|
||||
if (!$track->canView(Auth::user()))
|
||||
if (!$track->canView(Auth::user())) {
|
||||
return $this->notFound('Track not found!');
|
||||
}
|
||||
|
||||
if ($track->is_downloadable == false)
|
||||
if ($track->is_downloadable == false) {
|
||||
return $this->notFound('Track not found!');
|
||||
}
|
||||
|
||||
if (!in_array($format, Track::$CacheableFormats)) {
|
||||
return $this->notFound('Format not found!');
|
||||
|
|
|
@ -398,6 +398,9 @@ class Album extends Model implements Searchable, Commentable, Favouritable
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
*/
|
||||
public function getCacheKey($key)
|
||||
{
|
||||
return 'album-'.$this->id.'-'.$key;
|
||||
|
|
|
@ -24,7 +24,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Poniverse\Ponyfm\Contracts\Commentable;
|
||||
use Poniverse\Ponyfm\Contracts\GeneratesNotifications;
|
||||
|
||||
/**
|
||||
* Poniverse\Ponyfm\Models\Comment
|
||||
|
|
Loading…
Add table
Reference in a new issue