the browser-facing portion of osu!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Redirect old tumblr news post urls

nanaya b6f1edbe c8dd3425

+47
+7
app/Http/Controllers/NewsController.php
··· 119 119 } 120 120 } 121 121 122 + public function redirect($tumblrId) 123 + { 124 + $post = NewsPost::where('tumblr_id', $tumblrId)->firstOrFail(); 125 + 126 + return ujs_redirect(route('news.show', $post->slug)); 127 + } 128 + 122 129 /** 123 130 * Get News Post 124 131 *
+37
database/migrations/2022_09_13_080115_index_news_posts_tumblr_id.php
··· 1 + <?php 2 + 3 + // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. 4 + // See the LICENCE file in the repository root for full licence text. 5 + 6 + declare(strict_types=1); 7 + 8 + use Illuminate\Database\Migrations\Migration; 9 + use Illuminate\Database\Schema\Blueprint; 10 + use Illuminate\Support\Facades\Schema; 11 + 12 + return new class extends Migration 13 + { 14 + /** 15 + * Run the migrations. 16 + * 17 + * @return void 18 + */ 19 + public function up() 20 + { 21 + Schema::table('news_posts', function (Blueprint $table): void { 22 + $table->index('tumblr_id'); 23 + }); 24 + } 25 + 26 + /** 27 + * Reverse the migrations. 28 + * 29 + * @return void 30 + */ 31 + public function down() 32 + { 33 + Schema::table('news_posts', function (Blueprint $table): void { 34 + $table->dropIndex(['tumblr_id']); 35 + }); 36 + } 37 + };
+1
resources/assets/lib/utils/url.ts
··· 23 23 'groups', 24 24 'legal', 25 25 'multiplayer', 26 + 'news', 26 27 'notifications', 27 28 'oauth', 28 29 'rankings',
+2
routes/web.php
··· 257 257 Route::resource('rooms', 'RoomsController', ['only' => ['show']]); 258 258 }); 259 259 260 + Route::get('news/{tumblrId}', 'NewsController@redirect'); 261 + 260 262 Route::group(['as' => 'oauth.', 'prefix' => 'oauth', 'namespace' => 'OAuth'], function () { 261 263 Route::resource('authorized-clients', 'AuthorizedClientsController', ['only' => ['destroy']]); 262 264 Route::resource('clients', 'ClientsController', ['except' => ['create', 'edit', 'show']]);