@extends('layouts.admin') @section('title', 'YouTube') @section('content')
{{-- ================= 🩺 AUTO-POST STATUS ================= --}}

🩺 Auto-post status β€” pehli ❌ line hi asli wajah hai

@csrf
@csrf
@if ($tokenFailed > 0)
@csrf ⚠️ {{ $tokenFailed }} cards YouTube token toota hone ya roz ki upload limit ki wajah se "failed" pade hain (card ki galti nahi thi).
@endif
{{-- ================= SUB-MENU TABS ================= --}}
{{-- ================================================= --}} {{-- TAB "Settings" β€” CONNECTION --}} {{-- ================================================= --}} {{-- ================================================= --}} {{-- TAB "Settings" β€” AUTO POST --}} {{-- ================================================= --}} {{-- ================================================= --}} {{-- TAB 1: MANUAL POST --}} {{-- ================================================= --}}

πŸš€ Post Manually

Short (per card) = us card ka apna YouTube Short. Button dabate hi video ban ke upload hota hai β€” thoda time lag sakta hai.

@if (! $configured)

⚠️ Pehle Settings tab me apna YouTube channel connect karo.

@endif @if ($stories->isEmpty())

No stories yet.

@else
@foreach ($stories as $story)

{{ $story->title }} ({{ ucfirst($story->status) }})

@foreach ($story->parts as $part) @if ($part->cards->isNotEmpty() && ! ($story->type === 'rashifal_short' && (string) $part->body === 'short:all' && $part->cards->first()?->yt_status !== 'posted')) @php // πŸ“Ί Rashifal Short: poora part (intro + rashi + end frames) = EK video $isRashiShort = in_array($story->type, ['rashifal_short', 'rashifal_week'], true) && Route::has('admin.rashifal.short.upload'); $firstCard = $part->cards->sortBy('sort_order')->first(); @endphp
@if ($isRashiShort) {{ \App\Models\Story::rashiShortLabel($part->body) }} β€” {{ $story->type === 'rashifal_week' ? '1 Video' : '1 Short' }} Β· {{ $part->cards->count() }} frames @if ($firstCard?->yt_status === 'posted') βœ… YouTube par che β†— @elseif ($firstCard?->yt_status === 'failed') ❌ Fail: {{ Str::limit($firstCard->yt_error, 60) }} @endif @else Part {{ $part->sort_order }} Β· {{ $part->cards->count() }} cards @endif
@if ($isRashiShort) β–Ά Video jovo @if ($firstCard?->yt_status !== 'posted')
@csrf
@endif @endif
@csrf
@foreach ($part->cards as $card)
@if ($card->isYtPosted()) βœ“ On YouTube β†— βœ“ Uploaded @if ($card->yt_posted_at) πŸ•’ {{ $card->yt_posted_at->format('d M, h:i A') }} @endif @else @unless ($isRashiShort) {{-- Rashifal Short me ek card = video ka ek frame; upload upar wale button se --}}
@csrf
@endunless @if ($card->yt_status === 'failed') failed @if (filled($card->yt_error)) {{ Str::limit($card->yt_error, 90) }} @endif @endif @endif
@endforeach
@endif @endforeach
@endforeach
@endif
{{-- ================= AI CAPTION MODAL ================= --}} @push('scripts') @endpush @endsection