2022-06-10 10:47:46 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use App\Http\Controllers\API\UserController;
|
|
|
|
use App\Http\Controllers\V6\API\AlbumController;
|
|
|
|
use App\Http\Controllers\V6\API\AlbumSongController;
|
2022-10-18 14:07:41 +00:00
|
|
|
use App\Http\Controllers\V6\API\ArtistAlbumController;
|
2022-06-10 10:47:46 +00:00
|
|
|
use App\Http\Controllers\V6\API\ArtistController;
|
|
|
|
use App\Http\Controllers\V6\API\ArtistSongController;
|
|
|
|
use App\Http\Controllers\V6\API\DataController;
|
2022-09-15 09:07:25 +00:00
|
|
|
use App\Http\Controllers\V6\API\DeleteSongsController;
|
2022-06-10 10:47:46 +00:00
|
|
|
use App\Http\Controllers\V6\API\ExcerptSearchController;
|
2022-07-27 09:30:04 +00:00
|
|
|
use App\Http\Controllers\V6\API\FavoriteSongController;
|
2022-07-08 14:53:04 +00:00
|
|
|
use App\Http\Controllers\V6\API\FetchAlbumInformationController;
|
|
|
|
use App\Http\Controllers\V6\API\FetchArtistInformationController;
|
2022-10-21 20:06:43 +00:00
|
|
|
use App\Http\Controllers\V6\API\FetchRandomSongsInGenreController;
|
|
|
|
use App\Http\Controllers\V6\API\GenreController;
|
|
|
|
use App\Http\Controllers\V6\API\GenreSongController;
|
2022-06-10 10:47:46 +00:00
|
|
|
use App\Http\Controllers\V6\API\OverviewController;
|
|
|
|
use App\Http\Controllers\V6\API\PlayCountController;
|
2022-08-10 14:56:01 +00:00
|
|
|
use App\Http\Controllers\V6\API\PlaylistController;
|
|
|
|
use App\Http\Controllers\V6\API\PlaylistFolderController;
|
|
|
|
use App\Http\Controllers\V6\API\PlaylistFolderPlaylistController;
|
2022-06-10 10:47:46 +00:00
|
|
|
use App\Http\Controllers\V6\API\PlaylistSongController;
|
|
|
|
use App\Http\Controllers\V6\API\QueueController;
|
|
|
|
use App\Http\Controllers\V6\API\RecentlyPlayedSongController;
|
|
|
|
use App\Http\Controllers\V6\API\SongController;
|
|
|
|
use App\Http\Controllers\V6\API\SongSearchController;
|
2022-08-01 10:42:33 +00:00
|
|
|
use App\Models\Song;
|
2022-06-10 10:47:46 +00:00
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
|
|
|
|
Route::prefix('api')->middleware('api')->group(static function (): void {
|
|
|
|
Route::middleware('auth')->group(static function (): void {
|
|
|
|
Route::get('overview', [OverviewController::class, 'index']);
|
|
|
|
Route::get('data', [DataController::class, 'index']);
|
|
|
|
|
|
|
|
Route::apiResource('albums', AlbumController::class);
|
|
|
|
Route::apiResource('albums.songs', AlbumSongController::class);
|
|
|
|
Route::apiResource('artists', ArtistController::class);
|
|
|
|
Route::apiResource('artists.songs', ArtistSongController::class);
|
2022-10-18 14:07:41 +00:00
|
|
|
Route::apiResource('artists.albums', ArtistAlbumController::class);
|
2022-07-04 10:39:02 +00:00
|
|
|
|
2022-07-08 14:53:04 +00:00
|
|
|
Route::get('albums/{album}/information', FetchAlbumInformationController::class);
|
|
|
|
Route::get('artists/{artist}/information', FetchArtistInformationController::class);
|
|
|
|
|
2022-08-10 14:56:01 +00:00
|
|
|
Route::apiResource('playlist-folders', PlaylistFolderController::class);
|
|
|
|
Route::apiResource('playlist-folders.playlists', PlaylistFolderPlaylistController::class)->except('destroy');
|
|
|
|
Route::delete(
|
|
|
|
'playlist-folders/{playlistFolder}/playlists',
|
|
|
|
[PlaylistFolderPlaylistController::class, 'destroy']
|
|
|
|
);
|
|
|
|
|
2022-07-04 10:39:02 +00:00
|
|
|
Route::apiResource('playlists', PlaylistController::class);
|
2022-08-10 14:56:01 +00:00
|
|
|
Route::apiResource('playlists.songs', PlaylistSongController::class)->except('destroy');
|
|
|
|
Route::delete('playlists/{playlist}/songs', [PlaylistSongController::class, 'destroy']);
|
2022-07-04 10:39:02 +00:00
|
|
|
|
2022-08-01 10:42:33 +00:00
|
|
|
Route::apiResource('songs', SongController::class)->where(['song' => Song::ID_REGEX]);
|
2022-07-27 09:30:04 +00:00
|
|
|
Route::get('songs/recently-played', [RecentlyPlayedSongController::class, 'index']);
|
|
|
|
Route::get('songs/favorite', [FavoriteSongController::class, 'index']);
|
2022-09-15 09:07:25 +00:00
|
|
|
Route::delete('songs', DeleteSongsController::class);
|
2022-07-27 10:18:53 +00:00
|
|
|
|
2022-10-24 12:48:30 +00:00
|
|
|
Route::get('genres/{genre}/songs', GenreSongController::class)->where('genre', '.*');
|
|
|
|
Route::get('genres/{genre}/songs/random', FetchRandomSongsInGenreController::class)->where('genre', '.*');
|
|
|
|
Route::apiResource('genres', GenreController::class)->where(['genre' => '.*']);
|
2022-10-21 20:06:43 +00:00
|
|
|
|
2022-07-25 10:25:35 +00:00
|
|
|
Route::apiResource('users', UserController::class);
|
2022-06-10 10:47:46 +00:00
|
|
|
|
|
|
|
Route::get('search', ExcerptSearchController::class);
|
|
|
|
Route::get('search/songs', SongSearchController::class);
|
|
|
|
|
|
|
|
Route::get('queue/fetch', [QueueController::class, 'fetchSongs']);
|
|
|
|
|
|
|
|
Route::post('interaction/play', [PlayCountController::class, 'store']);
|
|
|
|
});
|
|
|
|
});
|