@extends('layouts.site') @section('content') @php $fullTitle = $production->translate('title'); $titlePart = $fullTitle; $stylePart = ''; if (preg_match('/^(.*?)\s*\((.*?)\)\s*$/u', $fullTitle, $matches)) { $titlePart = trim($matches[1]); $stylePart = trim($matches[2]); } $contentHtml = $production->translate('content'); $isYoutubeFormat = false; if (stripos($contentHtml, 'Provided to YouTube') !== false || stripos($contentHtml, 'Auto-generated by YouTube') !== false) { $isYoutubeFormat = true; } $trackNameParsed = null; $styleParsed = null; $distributor = null; $contributors = []; $label = null; $releasedOn = null; $remainingLines = []; if ($isYoutubeFormat) { $rawText = strip_tags(str_replace(['

', '

', '
', '
', '
'], ["\n", "\n", "\n", "\n", "\n"], $contentHtml)); $lines = array_filter(array_map('trim', explode("\n", $rawText))); foreach ($lines as $line) { if (empty($line)) continue; if (preg_match('/Provided to YouTube by\s+(.+)/i', $line, $m)) { $distributor = trim($m[1]); } elseif (strpos($line, '·') !== false) { $parts = array_map('trim', explode('·', $line)); if (count($parts) > 0) { $trackPart = $parts[0]; if (preg_match('/^(.*?)\s*\((.*?)\)\s*$/u', $trackPart, $tm)) { $trackNameParsed = trim($tm[1]); $styleParsed = trim($tm[2]); } else { $trackNameParsed = $trackPart; } for ($i = 1; $i < count($parts); $i++) { $contributors[] = $parts[$i]; } } } elseif (preg_match('/℗\s*(.+)/u', $line, $m)) { $label = trim($m[1]); } elseif (preg_match('/Released on:\s*(.+)/i', $line, $m)) { $releasedOn = trim($m[1]); } elseif (stripos($line, 'Auto-generated by YouTube') !== false) { // Skip line } elseif (stripos($line, 'YouTube\'da İzle') !== false || stripos($line, 'Watch on YouTube') !== false) { // Skip line } else { $normLine = trim(strtolower($line)); $normTitle = trim(strtolower($production->translate('title'))); if ($normLine === $normTitle || ($trackNameParsed && $normLine === trim(strtolower($trackNameParsed)))) { continue; } $remainingLines[] = $line; } } } @endphp
@if($production->client_name)
{{ $production->translate('client_name') }}
@endif

{{ $titlePart }}

@if($stylePart || $styleParsed)

{{ $stylePart ?: $styleParsed }}

@endif @if($production->production_date)

{{ $production->production_date->format('d.m.Y') }}

@endif
@php $videoId = null; if ($production->youtube_video_id) { $videoId = $production->youtube_video_id; } elseif ($production->youtube_url) { if (preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $production->youtube_url, $match)) { $videoId = $match[1]; } } @endphp {{-- Vinyl Player Mockup --}} @if($production->cover_image_url)
{{ $titlePart }}
{{ $stylePart ?: ($production->translate('client_name') ?: __('music_productions.card_category_default')) }}
@if($production->production_date) {{ $production->production_date->format('d.m.Y') }} @else   @endif
@if($prev) @else
@endif
@if($next) @else
@endif
@endif {{-- Hidden Background YouTube Player --}} @if($videoId)
@endif {{-- Content & Meta --}}

{{ __('music_productions.project_details') }}

{{-- Sidebar - Date & Client --}} {{-- Premium Metadata Table --}}
@if($styleParsed) @endif @if(!empty($contributors)) @endif @if($releasedOn) @endif @if($label) @endif @if($production->spotify_url) @endif @if($production->youtube_url) @endif
{{ __("music_productions.track") }} {{ $trackNameParsed ?? $titlePart }}
{{ __("music_productions.style") }} {{ $styleParsed }}
{{ __("music_productions.contributors") }} {{ implode(', ', $contributors) }}
{{ __("music_productions.released_on") }} {{ \Carbon\Carbon::parse($releasedOn)->format('d.m.Y') }}
{{ __("music_productions.label") }} {{ $label }}
Spotify {{ __('music_productions.spotify_listen_on_spotify') }}
{{ __("music_productions.youtube") }} {{ __('music_productions.youtube_watch_on_youtube') }}
{{-- Gallery --}} @php $gallery = $production->gallery; @endphp @if(!empty($gallery) && is_array($gallery) && count($gallery) > 0)
@foreach($gallery as $galleryImage) @endforeach
@endif
{{-- Post Navigation (Prev / Next) --}}
@push('styles') @endpush @push('scripts') @endpush @endsection