2022-06-10 10:47:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Facades\ITunes;
|
2024-02-05 21:17:41 +00:00
|
|
|
use App\Http\Controllers\AuthorizeDropboxController;
|
2024-01-03 17:02:18 +00:00
|
|
|
use App\Http\Controllers\Download\DownloadAlbumController;
|
|
|
|
use App\Http\Controllers\Download\DownloadArtistController;
|
|
|
|
use App\Http\Controllers\Download\DownloadFavoritesController;
|
|
|
|
use App\Http\Controllers\Download\DownloadPlaylistController;
|
|
|
|
use App\Http\Controllers\Download\DownloadSongsController;
|
2024-03-31 17:19:03 +00:00
|
|
|
use App\Http\Controllers\IndexController;
|
2022-06-10 10:47:46 +00:00
|
|
|
use App\Http\Controllers\LastfmController;
|
|
|
|
use App\Http\Controllers\PlayController;
|
2024-03-30 16:49:25 +00:00
|
|
|
use App\Http\Controllers\SSO\GoogleCallbackController;
|
2024-01-03 17:02:18 +00:00
|
|
|
use App\Http\Controllers\ViewSongOnITunesController;
|
2022-06-10 10:47:46 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
2024-03-30 16:49:25 +00:00
|
|
|
use Laravel\Socialite\Facades\Socialite;
|
2022-06-10 10:47:46 +00:00
|
|
|
|
|
|
|
Route::middleware('web')->group(static function (): void {
|
2024-03-31 17:19:03 +00:00
|
|
|
Route::get('/', IndexController::class);
|
2022-06-10 10:47:46 +00:00
|
|
|
|
|
|
|
Route::get('remote', static fn () => view('remote'));
|
|
|
|
|
|
|
|
Route::middleware('auth')->group(static function (): void {
|
|
|
|
Route::prefix('lastfm')->group(static function (): void {
|
|
|
|
Route::get('connect', [LastfmController::class, 'connect'])->name('lastfm.connect');
|
|
|
|
Route::get('callback', [LastfmController::class, 'callback'])->name('lastfm.callback');
|
|
|
|
});
|
|
|
|
|
|
|
|
if (ITunes::used()) {
|
2024-01-03 17:02:18 +00:00
|
|
|
Route::get('itunes/song/{album}', ViewSongOnITunesController::class)->name('iTunes.viewSong');
|
2022-06-10 10:47:46 +00:00
|
|
|
}
|
2022-11-16 17:57:38 +00:00
|
|
|
});
|
|
|
|
|
2024-03-30 16:49:25 +00:00
|
|
|
Route::get('auth/google/redirect', static fn () => Socialite::driver('google')->redirect());
|
|
|
|
Route::get('auth/google/callback', GoogleCallbackController::class);
|
|
|
|
|
2024-02-05 21:17:41 +00:00
|
|
|
Route::get('dropbox/authorize', AuthorizeDropboxController::class)->name('dropbox.authorize');
|
|
|
|
|
2022-11-16 17:57:38 +00:00
|
|
|
Route::middleware('audio.auth')->group(static function (): void {
|
2024-09-03 14:51:23 +00:00
|
|
|
Route::get('play/{song}/{transcode?}', PlayController::class)->name('song.play');
|
2022-06-10 10:47:46 +00:00
|
|
|
|
2024-01-07 12:43:10 +00:00
|
|
|
if (config('koel.download.allow')) {
|
|
|
|
Route::prefix('download')->group(static function (): void {
|
|
|
|
Route::get('songs', DownloadSongsController::class);
|
|
|
|
Route::get('album/{album}', DownloadAlbumController::class);
|
|
|
|
Route::get('artist/{artist}', DownloadArtistController::class);
|
|
|
|
Route::get('playlist/{playlist}', DownloadPlaylistController::class);
|
|
|
|
Route::get('favorites', DownloadFavoritesController::class);
|
|
|
|
});
|
|
|
|
}
|
2022-06-10 10:47:46 +00:00
|
|
|
});
|
|
|
|
});
|