mirror of
https://github.com/koel/koel
synced 2024-11-10 22:54:16 +00:00
Refactor useLastfm config
This commit is contained in:
parent
bec05931b3
commit
27b44ec79c
3 changed files with 15 additions and 1 deletions
|
@ -8,6 +8,7 @@ use App\Models\Interaction;
|
|||
use App\Models\Playlist;
|
||||
use App\Models\Setting;
|
||||
use App\Models\User;
|
||||
use Lastfm;
|
||||
|
||||
class DataController extends Controller
|
||||
{
|
||||
|
@ -32,7 +33,7 @@ class DataController extends Controller
|
|||
'interactions' => Interaction::byCurrentUser()->get(),
|
||||
'users' => auth()->user()->is_admin ? User::all() : [],
|
||||
'currentUser' => auth()->user(),
|
||||
'useLastfm' => env('LASTFM_API_KEY') && env('LASTFM_API_SECRET'),
|
||||
'useLastfm' => Lastfm::used(),
|
||||
'allowDownload' => env('ALLOW_DOWNLOAD', true),
|
||||
'cdnUrl' => app()->staticUrl(),
|
||||
'currentVersion' => Application::VERSION,
|
||||
|
|
|
@ -60,5 +60,8 @@ Route::group(['prefix' => 'api', 'namespace' => 'API'], function () {
|
|||
Route::get('playlist/{playlist}', 'PlaylistController@download');
|
||||
Route::get('favorites', 'FavoritesController@download');
|
||||
});
|
||||
|
||||
// Info routes
|
||||
//if (Lastfm::used())
|
||||
});
|
||||
});
|
||||
|
|
|
@ -40,6 +40,16 @@ class Lastfm extends RESTfulService
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if our application is using Last.fm.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function used()
|
||||
{
|
||||
return env('LASTFM_API_KEY') && env('LASTFM_API_SECRET');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if Last.fm integration is enabled.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue