mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
Applied fixes from StyleCI
This commit is contained in:
parent
bdb76a3c9b
commit
1d417221bf
5 changed files with 11 additions and 11 deletions
|
@ -2,10 +2,10 @@
|
|||
|
||||
namespace App\Http\Controllers\API;
|
||||
|
||||
use App\Services\Lastfm;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use App\Services\Lastfm;
|
||||
|
||||
class LastfmController extends Controller
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ class Song extends Model
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function scrobble($timestamp)
|
||||
public function scrobble($timestamp)
|
||||
{
|
||||
// Don't scrobble the unknown guys. No one knows them.
|
||||
if ($this->album->artist->id === Artist::UNKNOWN_ID) {
|
||||
|
@ -53,8 +53,8 @@ class Song extends Model
|
|||
}
|
||||
|
||||
return Lastfm::scrobble(
|
||||
$this->album->artist->name,
|
||||
$this->title,
|
||||
$this->album->artist->name,
|
||||
$this->title,
|
||||
$timestamp,
|
||||
$this->album->name === Album::UNKNOWN_NAME ? '' : $this->album->name,
|
||||
$sessionKey
|
||||
|
|
|
@ -85,7 +85,7 @@ AuthenticatableContract,
|
|||
$preferences = $this->preferences;
|
||||
$preferences[$key] = $val;
|
||||
$this->preferences = $preferences;
|
||||
|
||||
|
||||
$this->save();
|
||||
}
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ class Lastfm extends RESTfulService
|
|||
$params['method'] = 'track.scrobble';
|
||||
|
||||
try {
|
||||
return !!$this->post('/', $this->buildAuthCallParams($params), false);
|
||||
return (bool) $this->post('/', $this->buildAuthCallParams($params), false);
|
||||
} catch (\Exception $e) {
|
||||
Log::error($e);
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\API\LastfmController;
|
||||
use App\Models\User;
|
||||
use App\Services\Lastfm;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use App\Models\User;
|
||||
use App\Http\Controllers\API\LastfmController;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\Request;;
|
||||
use Mockery as m;
|
||||
|
||||
class LastfmTest extends TestCase
|
||||
|
@ -107,7 +107,7 @@ class LastfmTest extends TestCase
|
|||
'api_sig' => '7f21233b54edea994aa0f23cf55f18a2',
|
||||
], $api->buildAuthCallParams($params));
|
||||
|
||||
$this->assertEquals('api_key=key&bar=baz&qux=安&api_sig=7f21233b54edea994aa0f23cf55f18a2',
|
||||
$this->assertEquals('api_key=key&bar=baz&qux=安&api_sig=7f21233b54edea994aa0f23cf55f18a2',
|
||||
$api->buildAuthCallParams($params, true));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue