Video merge feature, default avatar, video-redirects table, misc UI tweaks

Bundled pre-existing changes on the branch:
- Video merge: controller, service, admin merge modal, and a repair
  console command; new video_redirects table (with source_folder)
  so merged/moved videos keep resolving under their old keys.
- Default avatar SVG for users without a profile picture.
- Assorted view tweaks across profile, video actions/comments/insights,
  admin layout, video-details, and the app layout.
- Small touch-ups in SuperAdminController, User model, NasSyncService.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
ghassanandClaude Opus 4.7 committed 2026-07-31 02:42:43 +03:00
1 parent ba8ab11ce4
commit 8d27520bdb
17 files changed
+736 -13

No files matched your search

@@ -128,6 +128,12 @@
<i class="bi bi-pencil"></i>
<span>Edit</span>
</button>
@if($video->type === 'music')
<button class="action-btn desktop-action" onclick="openMergeModal('{{ $video->getRouteKey() }}')">
<i class="bi bi-signpost-split"></i>
<span>Merge</span>
</button>
@endif
{{-- Lyrics generate/regenerate + edit now live inside the player's gear menu
so they're always reachable on both mobile and desktop. --}}
<button class="action-btn desktop-action" onclick="showDeleteModal('{{ $video->getRouteKey() }}', {{ json_encode($video->title) }})"
@@ -250,6 +256,11 @@
<button type="button" class="dropdown-item" onclick="openEditVideoModal('{{ $video->getRouteKey() }}')">
<i class="bi bi-pencil"></i> Edit
</button>
@if($video->type === 'music')
<button type="button" class="dropdown-item" onclick="openMergeModal('{{ $video->getRouteKey() }}')">
<i class="bi bi-signpost-split"></i> Merge
</button>
@endif
@endif
@else
<button class="dropdown-item" onclick="window.location.href='{{ route('login') }}'">
@@ -24,8 +24,8 @@
if (!function_exists('ytcAvatar')) {
function ytcAvatar($user) {
if (!$user) return 'https://ui-avatars.com/api/?name=User&background=333&color=fff';
return $user->avatar_url ?? ('https://ui-avatars.com/api/?name='.urlencode($user->name ?? 'User').'&background=333&color=fff');
if (!$user) return asset('images/default-avatar.svg');
return $user->avatar_url ?? asset('images/default-avatar.svg');
}
}
if (!function_exists('ytcTime')) {
@@ -707,8 +707,8 @@ function esc(s) {
}
function fmt(s) { return s ?? ''; }
function avatarUrl(user) {
if (!user) return 'https://ui-avatars.com/api/?name=User&background=333&color=fff';
return user.avatar_url || ('https://ui-avatars.com/api/?name=' + encodeURIComponent(user.name || 'User') + '&background=333&color=fff');
if (!user) return '{{ asset('images/default-avatar.svg') }}';
return user.avatar_url || '{{ asset('images/default-avatar.svg') }}';
}
// ── Toast (use global if available, else local) ───────
@@ -468,7 +468,7 @@ function renderInsights(d) {
</div>`).join('');
const recentViewerRows = (d.recent_viewers || []).map(r => {
const avatarSrc = r.user_avatar || `https://i.pravatar.cc/150?u=guest-${r.country||'unknown'}`;
const avatarSrc = r.user_avatar || '{{ asset('images/default-avatar.svg') }}';
const title = `Tap for full activity — ${r.user_name}`;
const safeName = (r.user_name || 'Viewer').replace(/'/g, "\\'");
return `<div class="ins-dl-user-row" title="${title}"
@@ -554,7 +554,7 @@ function renderInsights(d) {
: '';
const recentRows = (d.dl_recent||[]).map(r => {
const avatarSrc = r.user_avatar || `https://i.pravatar.cc/150?u=guest-${r.country||'unknown'}`;
const avatarSrc = r.user_avatar || '{{ asset('images/default-avatar.svg') }}';
const safeName = (r.user_name || 'Downloader').replace(/'/g, "\\'");
const clickAttr = r.user_id
? `onclick="openDownloaderHistory(${r.user_id},'${safeName}','${avatarSrc}')" style="cursor:pointer;" title="See full download history"`