lastfmService = $lastfmService; $this->youTubeService = $youTubeService; $this->iTunesService = $iTunesService; $this->mediaCacheService = $mediaCacheService; } /** * Get a set of application data. * * @return JsonResponse */ public function index(Request $request) { return response()->json($this->mediaCacheService->get() + [ 'settings' => $request->user()->is_admin ? Setting::pluck('value', 'key')->all() : [], 'playlists' => Playlist::byCurrentUser()->orderBy('name')->get()->toArray(), 'interactions' => Interaction::byCurrentUser()->get(), 'users' => $request->user()->is_admin ? User::all() : [], 'currentUser' => $request->user(), 'useLastfm' => $this->lastfmService->used(), 'useYouTube' => $this->youTubeService->enabled(), 'useiTunes' => $this->iTunesService->used(), 'allowDownload' => config('koel.download.allow'), 'supportsTranscoding' => config('koel.streaming.ffmpeg_path') && is_executable(config('koel.streaming.ffmpeg_path')), 'cdnUrl' => app()->staticUrl(), 'currentVersion' => Application::KOEL_VERSION, 'latestVersion' => $request->user()->is_admin ? app()->getLatestVersion() : Application::KOEL_VERSION, ]); } }