@extends('admin.layout') @section('title', 'Scan Storage') @section('content')

🔍 Scan Storage Bucket

Scan & Import. Scan file video (.mp4, .m3u8) dari bucket storage, auto-detect thumbnail, lalu import ke database. Laravel TIDAK download, TIDAK copy, TIDAK reupload — hanya mendaftarkan pointer.

âąī¸ Auto Scan Storage (Job)

@php $autoEnabled = (bool) data_get($autoScanSettings ?? [], 'enabled', false); @endphp {{ $autoEnabled ? 'AKTIF' : 'NONAKTIF' }}
@csrf @method('PUT')
@php $selectedPrefixes = old('auto_scan_prefixes', $selectedAutoPrefixes ?? []); @endphp @forelse(($autoScanPrefixes ?? []) as $prefix) @empty
Prefix belum terdeteksi untuk driver ini.
@endforelse
@csrf Cron tetap jalankan php artisan schedule:run tiap menit agar job ini berjalan.
@if(session('auto_scan_output'))
Output Run Auto Scan Now:
{{ session('auto_scan_output') }}
@endif @if(!empty($autoScanLastStatus))
Last Auto Scan: {{ data_get($autoScanLastStatus, 'ran_at', '-') }} | New: {{ data_get($autoScanLastStatus, 'new_found', 0) }} | Imported: {{ data_get($autoScanLastStatus, 'imported', 0) }} | Skipped: {{ data_get($autoScanLastStatus, 'skipped', 0) }}
@endif @if(!empty($autoScanHeartbeat)) @php $heartbeatAt = data_get($autoScanHeartbeat, 'at'); $hbFresh = false; if ($heartbeatAt) { try { $hbFresh = \Illuminate\Support\Carbon::parse($heartbeatAt)->gt(now()->subMinutes(2)); } catch (\Throwable $e) { $hbFresh = false; } } @endphp
Scheduler Heartbeat: {{ $hbFresh ? 'AKTIF' : 'LAMBAT/TIDAK TERBARU' }} | Last ping: {{ $heartbeatAt ?: '-' }} @if(data_get($autoScanHeartbeat, 'host')) | Host: {{ data_get($autoScanHeartbeat, 'host') }} @endif @if(data_get($autoScanHeartbeat, 'pid')) | PID: {{ data_get($autoScanHeartbeat, 'pid') }} @endif
@endif
@if($errors->any())
@endif {{-- ═══════════════════════════════════════════ --}} {{-- SCAN FORM --}} {{-- ═══════════════════════════════════════════ --}}
@csrf
{{-- Storage Driver --}}
{{-- Video Prefix --}}
{{-- Thumbnail Prefix --}}
{{-- Scan Button --}}
Kembali
{{-- ═══════════════════════════════════════════ --}} {{-- SCAN NEW PROGRESS PANEL --}} {{-- ═══════════════════════════════════════════ --}} {{-- ═══════════════════════════════════════════ --}} {{-- SCAN RESULTS --}} {{-- ═══════════════════════════════════════════ --}} @if($scanResults !== null)
Ditemukan {{ $scanResults['total'] }} file @if($scanResults['truncated']) (menampilkan max {{ count($scanResults['files']) }}) @endif
{{-- Filter Buttons --}}
{{-- Prefix Search --}} Filter:
@if(count($scanResults['files']) > 0)
@csrf {{-- Toolbar --}}
{{-- Import All New button --}} @php $newCount = collect($scanResults['files'])->where('already_imported', false)->count(); @endphp @if($newCount > 0) @endif ✅ = thumbnail detected   âŦœ = no thumbnail   đŸ”ĩ = already imported
{{-- Pagination Top --}}
{{-- Results Table --}} @foreach($scanResults['files'] as $index => $file) @endforeach
File Path Type Size Thumbnail Status
@if(!$file['already_imported']) @else đŸ”ĩ @endif
{{ $file['path'] }}
{{ $file['filename'] }}
{{ strtoupper($file['type']) }} {{ $file['size_human'] ?? '—' }} @if($file['has_thumbnail']) ✅ {{ basename($file['thumbnail_path']) }} @else âŦœ not found @endif @if($file['already_imported']) imported @else new @endif
{{-- Pagination Bottom --}}
@else

Tidak ditemukan file video di prefix "{{ $videoPrefix }}".

Pastikan video prefix dan storage driver sudah benar.

@endif @endif @endsection