Fixed a bad query.

This commit is contained in:
Peter Deltchev 2016-05-28 12:53:18 -07:00
parent 27f19f9dc7
commit 716eff3955
2 changed files with 4 additions and 3 deletions

View file

@ -88,8 +88,7 @@ class Album extends Model implements Searchable, Commentable, Favouritable
'users' => function($query) {
$query->whereUserId(Auth::user()->id);
}
])
->with('users.avatar');
]);
}
return !$query;

View file

@ -263,6 +263,7 @@ class Track extends Model implements Searchable, Commentable, Favouritable
/**
* @param integer $count
* @return array
*/
public static function popular($count, $allowExplicit = false)
{
@ -562,7 +563,6 @@ class Track extends Model implements Searchable, Commentable, Favouritable
*/
public function getFilesize($formatName)
{
// $trackFile = $this->trackFiles()->where('format', $formatName)->first();
$trackFile = $this->trackFiles->where('format', $formatName)->first();
if ($trackFile) {
@ -681,7 +681,9 @@ class Track extends Model implements Searchable, Commentable, Favouritable
}
/**
* @param $format
* @return string
* @throws Exception
*/
public function getFileFor($format)
{