@extends('layouts.app') @section('content') @php $isDigitised = old('digitised', $album->digitised ? 'y' : 'n'); $relaxedValue = old('relaxed_date', optional($album->relaxed_date)->format('Y-m-d')); $recordRestoreTreatments = ($album->treatments ?? collect())->filter(function ($treatment) { return strcasecmp((string) $treatment->treatment_type, 'Record Restore') === 0; })->values(); $lastRecordRestoreDate = old('lastRecordRestoreDate', optional($recordRestoreTreatments->first()?->treated_on)->toDateString()); $loggedPlayCount = $album->relationLoaded('playLogs') ? $album->playLogs->count() : $album->playLogs()->count(); $playsSinceLastRestore = $lastRecordRestoreDate ? ($album->relationLoaded('playLogs') ? $album->playLogs->filter(fn ($playLog) => $playLog->played_at && $playLog->played_at->toDateString() >= $lastRecordRestoreDate)->count() : $album->playLogs()->whereDate('played_at', '>=', $lastRecordRestoreDate)->count()) : $loggedPlayCount; $needsTreatmentValue = old('needs_treatment', ($album->needs_treatment ?? false) ? '1' : '0'); $genreOptions = [ 'Rock', 'Pop', 'Jazz', 'Blues', 'Classical', 'Electronic', 'Hip Hop', 'Rap', 'Soul', 'Funk', 'Reggae', 'Country', 'Folk', 'Metal', 'Punk', 'Disco', 'House', 'Techno', 'Ambient', 'Soundtrack' ]; @endphp
Collection management

Album edit

{{ $album->artist?->name ?: 'Unknown artist' }} ยท {{ $album->title }}
Back to listing
@if ($errors->any())
Please review the highlighted information.
@endif
Treatment history
Relaxed status
{{ $relaxedValue ? 'Relaxed' : 'Not relaxed' }}
{{ $relaxedValue ? 'One-time treatment recorded on ' . \Illuminate\Support\Carbon::parse($relaxedValue)->format('j M Y') : 'No relaxing date is currently recorded.' }}
Record Restore
{{ $recordRestoreTreatments->count() }} {{ \Illuminate\Support\Str::plural('treatment', $recordRestoreTreatments->count()) }}
@if ($lastRecordRestoreDate) Last treatment {{ \Illuminate\Support\Carbon::parse($lastRecordRestoreDate)->format('j M Y') }} @else No Record Restore treatments have been logged yet. @endif
Plays since restore {{ $playsSinceLastRestore }}
Treatment due {{ (($album->needs_treatment ?? false) || $playsSinceLastRestore >= 10) ? 'Yes' : 'No' }}
Record Restore history
@if ($recordRestoreTreatments->isEmpty())
No Record Restore entries yet for this album.
@else
@foreach ($recordRestoreTreatments as $treatment)
{{ optional($treatment->treated_on)->format('j M Y') }}
{{ $treatment->treatment_type }}
{{ $treatment->notes ?: 'No notes recorded' }}
@endforeach
@endif
@csrf @method('PUT')
Album details
Cancel
@endsection