chore(api): remove redundant YouTube controller

This commit is contained in:
Phan An 2022-07-27 12:18:53 +02:00
parent 93651a8e14
commit 6e2f3764cc
No known key found for this signature in database
GPG key ID: A81E4477F0BB6FDC
2 changed files with 1 additions and 23 deletions

View file

@ -1,16 +0,0 @@
<?php
namespace App\Http\Controllers\V6\API;
use App\Http\Controllers\API\Controller;
use App\Http\Controllers\V6\Requests\YouTubeSearchRequest;
use App\Models\Song;
use App\Services\YouTubeService;
class YouTubeSearchController extends Controller
{
public function __invoke(YouTubeSearchRequest $request, Song $song, YouTubeService $youTubeService)
{
return $youTubeService->searchVideosRelatedToSong($song, (string) $request->pageToken);
}
}

View file

@ -1,6 +1,5 @@
<?php
use App\Facades\YouTube;
use App\Http\Controllers\API\PlaylistController;
use App\Http\Controllers\API\UserController;
use App\Http\Controllers\V6\API\AlbumController;
@ -19,7 +18,6 @@ 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;
use App\Http\Controllers\V6\API\YouTubeSearchController;
use Illuminate\Support\Facades\Route;
Route::prefix('api')->middleware('api')->group(static function (): void {
@ -43,7 +41,7 @@ Route::prefix('api')->middleware('api')->group(static function (): void {
Route::apiResource('songs', SongController::class)->where(['song' => '[a-f0-9]{32}']);
Route::get('songs/recently-played', [RecentlyPlayedSongController::class, 'index']);
Route::get('songs/favorite', [FavoriteSongController::class, 'index']);
Route::apiResource('users', UserController::class);
Route::get('search', ExcerptSearchController::class);
@ -51,10 +49,6 @@ Route::prefix('api')->middleware('api')->group(static function (): void {
Route::get('queue/fetch', [QueueController::class, 'fetchSongs']);
if (YouTube::enabled()) {
Route::get('youtube/search/song/{song}', YouTubeSearchController::class);
}
Route::post('interaction/play', [PlayCountController::class, 'store']);
});
});