mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
chore: move Spotify client to Integrations
This commit is contained in:
parent
a501613052
commit
a4366fe3b1
4 changed files with 4 additions and 27 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace App\Services\ApiClients;
|
||||
namespace App\Http\Integrations\Spotify;
|
||||
|
||||
use App\Exceptions\SpotifyIntegrationDisabledException;
|
||||
use App\Services\SpotifyService;
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Http\Integrations\Spotify\SpotifyClient;
|
||||
use App\Models\Album;
|
||||
use App\Models\Artist;
|
||||
use App\Services\ApiClients\SpotifyClient;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class SpotifyService
|
||||
|
@ -45,7 +45,7 @@ class SpotifyService
|
|||
}
|
||||
|
||||
return Arr::get(
|
||||
$this->client->search("{$album->name} artist:{$album->artist->name}", 'album', ['limit' => 1]),
|
||||
$this->client->search("$album->name artist:{$album->artist->name}", 'album', ['limit' => 1]),
|
||||
'albums.items.0.images.0.url'
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace Tests\Unit\Services;
|
||||
|
||||
use App\Http\Integrations\Spotify\SpotifyClient;
|
||||
use App\Models\Album;
|
||||
use App\Models\Artist;
|
||||
use App\Services\ApiClients\SpotifyClient;
|
||||
use App\Services\SpotifyService;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Mockery;
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Stubs;
|
||||
|
||||
use App\Services\ApiClients\ApiClient;
|
||||
|
||||
class ConcreteApiClient extends ApiClient
|
||||
{
|
||||
public function getKey(): string
|
||||
{
|
||||
return 'bar';
|
||||
}
|
||||
|
||||
public function getSecret(): string
|
||||
{
|
||||
return 'secret';
|
||||
}
|
||||
|
||||
public function getEndpoint(): string
|
||||
{
|
||||
return 'https://foo.com';
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue