diff --git a/app/Http/Controllers/Auth/DiscordAuthController.php b/app/Http/Controllers/Auth/DiscordAuthController.php index 1a869a4..fc30acf 100644 --- a/app/Http/Controllers/Auth/DiscordAuthController.php +++ b/app/Http/Controllers/Auth/DiscordAuthController.php @@ -31,14 +31,13 @@ class DiscordAuthController extends Controller $user = User::where('discord_id', $discordUser->id)->first(); - if (! $user) { + if (!$user) { // link by email if it already exists $user = User::where('email', $discordUser->email)->first(); if ($user) { $user->update([ 'discord_id' => $discordUser->id, - 'discord_name' => $discordUser->nickname ?? $discordUser->name, 'discord_avatar' => $discordUser->avatar, ]); } else { @@ -47,7 +46,6 @@ class DiscordAuthController extends Controller 'name' => $discordUser->name, 'email' => $discordUser->email, 'discord_id' => $discordUser->id, - 'discord_name' => $discordUser->nickname ?? $discordUser->name, 'discord_avatar' => $discordUser->avatar, 'password' => bcrypt(Str::random(40)), ]); diff --git a/app/Livewire/AdminUserSearch.php b/app/Livewire/AdminUserSearch.php index 36e18e9..b4b15c1 100644 --- a/app/Livewire/AdminUserSearch.php +++ b/app/Livewire/AdminUserSearch.php @@ -43,10 +43,7 @@ class AdminUserSearch extends Component $users = User::when($this->filtered !== [], fn ($query) => $query->where('id', '>=', 10000)) ->when($this->patreon !== [], fn ($query) => $query->where('is_patreon', 1)) ->when($this->banned !== [], fn ($query) => $query->where('is_banned', 1)) - ->when($this->search !== '', fn ($query) => $query->where(function($query) { - $query->where('name', 'like', '%'.$this->search.'%') - ->orWhere('discord_name', 'like', '%'.$this->search.'%'); - })) + ->when($this->search !== '', fn ($query) => $query->where('name', 'like', '%'.$this->search.'%')) ->paginate(20); return view('livewire.admin-user-search', [ diff --git a/app/Models/User.php b/app/Models/User.php index 9fd5cfb..37d6ac4 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -29,7 +29,6 @@ class User extends Authenticatable 'is_banned', // Discord 'discord_id', - 'discord_name', 'discord_avatar', ]; @@ -60,26 +59,9 @@ class User extends Authenticatable 'tag_blacklist' => 'array', // Discord 'discord_id' => 'integer', - 'discord_name' => 'string', 'discord_avatar' => 'string', ]; - /** - * Get the user name - */ - public function getUserName(): string - { - if (!$this->discord_name) { - return $this->name; - } - - if ($this->discord_name == $this->name) - { - return $this->name; - } - - return "{$this->name} ({$this->discord_name})"; - } /** * Has Many Playlists. diff --git a/app/Override/Comments/CommentService.php b/app/Override/Comments/CommentService.php index 3b47f3c..72cb389 100644 --- a/app/Override/Comments/CommentService.php +++ b/app/Override/Comments/CommentService.php @@ -122,12 +122,11 @@ class CommentService $url = '/hentai/' . $episode->slug . '#comment-' . $reply->id; $user = Auth::user(); - $username = $user->discord_name ?? $user->name; $parentCommentUser = User::where('id', $comment->commenter_id)->firstOrFail(); $parentCommentUser->notify( new CommentNotification( - "{$username} replied to your comment.", + "{$user->name} replied to your comment.", Str::limit($reply->comment, 50), $url ) diff --git a/database/migrations/2026_01_06_161620_fix_discord_oauth_system.php b/database/migrations/2026_01_06_161620_fix_discord_oauth_system.php index 4d69195..d436f11 100644 --- a/database/migrations/2026_01_06_161620_fix_discord_oauth_system.php +++ b/database/migrations/2026_01_06_161620_fix_discord_oauth_system.php @@ -26,14 +26,16 @@ return new class extends Migration $table->dropColumn('public_flags'); $table->dropColumn('verified'); $table->dropColumn('mfa_enabled'); + $table->dropColumn('global_name'); + $table->dropColumn('locale'); }); // Change & Add Columns Schema::table('users', function (Blueprint $table) { // Rename $table->renameColumn('username', 'name'); - $table->renameColumn('global_name', 'discord_name'); $table->renameColumn('avatar', 'discord_avatar'); + $table->string('avatar')->nullable()->after('email'); // Re-Add Email verification $table->timestamp('email_verified_at')->nullable()->after('email'); diff --git a/resources/views/layouts/navigation.blade.php b/resources/views/layouts/navigation.blade.php index ddf17f1..c33ad5d 100644 --- a/resources/views/layouts/navigation.blade.php +++ b/resources/views/layouts/navigation.blade.php @@ -97,7 +97,7 @@ @if (Auth::user()->discord_avatar) {{ Auth::user()->getUserName() }} + alt="{{ Auth::user()->name }}" /> @endif @else - {{ Auth::user()->getUserName() }} + {{ Auth::user()->name }} @if ($notAvailable) @endif @@ -234,7 +234,7 @@ @if (Auth::user()->discord_avatar) {{ Auth::user()->getUserName() }} + alt="{{ Auth::user()->name }}" /> @else Guest diff --git a/resources/views/livewire/admin-user-search.blade.php b/resources/views/livewire/admin-user-search.blade.php index a9ebe62..5c5afc3 100644 --- a/resources/views/livewire/admin-user-search.blade.php +++ b/resources/views/livewire/admin-user-search.blade.php @@ -60,7 +60,7 @@ {{ $user->id }} - {{ $user->discord_name ?? $user->name }} + {{ $user->name }} {{ $user->is_patreon ? 'Yes' : 'No' }} diff --git a/resources/views/partials/comment.blade.php b/resources/views/partials/comment.blade.php index c14762f..6f13653 100644 --- a/resources/views/partials/comment.blade.php +++ b/resources/views/partials/comment.blade.php @@ -7,17 +7,17 @@ @php $user = cache()->rememberForever('commentUser'.$comment->commenter_id, fn () => \App\Models\User::where('id', $comment->commenter_id)->first()); @endphp
@if($user->discord_avatar) - {{ $user->discord_name ?? $user->name }} Avatar + {{ $user->name }} Avatar @else - {{ $user->discord_name ?? $user->name }} Avatar + {{ $user->name }} Avatar @endif
@if($user->is_patreon) -
{{ $user->discord_name ?? $user->name }} - {{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}
+
{{ $user->name }} - {{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}
@else -
{{ $user->discord_name ?? $user->name }} - {{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}
+
{{ $user->name }} - {{ \Carbon\Carbon::parse($comment->created_at)->diffForHumans() }}
@endif
{!! $markdown->line($comment->comment) !!}
diff --git a/resources/views/profile/partials/update-profile-information-form.blade.php b/resources/views/profile/partials/update-profile-information-form.blade.php index f6186ad..d3bd30a 100644 --- a/resources/views/profile/partials/update-profile-information-form.blade.php +++ b/resources/views/profile/partials/update-profile-information-form.blade.php @@ -23,14 +23,6 @@
- @if (Auth::user()->discord_name) -
- - - -
- @endif -
diff --git a/resources/views/stream/partials/playlist.blade.php b/resources/views/stream/partials/playlist.blade.php index b0e2066..98f20e6 100644 --- a/resources/views/stream/partials/playlist.blade.php +++ b/resources/views/stream/partials/playlist.blade.php @@ -22,7 +22,7 @@ } @endphp

- {{ $playlist->user->discord_name ?? $playlist->user->name }} • {{ $currentIndex + 1 }}/{{ $episodeCount }} Episodes + {{ $playlist->user->name }} • {{ $currentIndex + 1 }}/{{ $episodeCount }} Episodes

diff --git a/resources/views/user/partials/profile.blade.php b/resources/views/user/partials/profile.blade.php index e2eae71..33871bc 100644 --- a/resources/views/user/partials/profile.blade.php +++ b/resources/views/user/partials/profile.blade.php @@ -8,7 +8,7 @@ @endif
- {{ $user->discord_name ?? $user->name }} + {{ $user->name }} @if ($user->is_patreon) diff --git a/resources/views/vendor/comments/_comment.blade.php b/resources/views/vendor/comments/_comment.blade.php index 2a85d50..5dc0c83 100644 --- a/resources/views/vendor/comments/_comment.blade.php +++ b/resources/views/vendor/comments/_comment.blade.php @@ -9,18 +9,18 @@
@if($comment->commenter->discord_avatar) - {{ $comment->commenter->discord_name ?? $comment->commenter->name }} Avatar + {{ $comment->commenter->name }} Avatar @else - {{ $comment->commenter->discord_name ?? $comment->commenter->name }} Avatar + {{ $comment->commenter->name }} Avatar @endif
@if($comment->commenter->is_patreon) -
{{ $comment->commenter->discord_name ?? $comment->commenter->name }} - {{ $comment->created_at->diffForHumans() }}
+
{{ $comment->commenter->name }} - {{ $comment->created_at->diffForHumans() }}
@else -
{{ $comment->commenter->discord_name ?? $comment->commenter->name }} - {{ $comment->created_at->diffForHumans() }}
+
{{ $comment->commenter->name }} - {{ $comment->created_at->diffForHumans() }}
@endif
{!! $markdown->line($comment->comment) !!}