Skip to content

A self-hosted media server and file management system

fix: folder preview generation fails if folder has no banner or poster

aminnausinc576eb44b6c5
diff --git a/app/Services/PreviewGeneratorService.php b/app/Services/PreviewGeneratorService.php
index be2da4e8..8d0750ab 100644
--- a/app/Services/PreviewGeneratorService.php
+++ b/app/Services/PreviewGeneratorService.php
@@ -178,8 +178,8 @@ class PreviewGeneratorService {
$series = $folder->series;
$seriesPoster = $series->primaryPoster?->path ? "storage/{$series->primaryPoster->path}" : $series->thumbnail_url;
- $banner = $series->primaryBanner?->path ? "storage/{$series->primaryBanner->path}" : $seriesPoster;
$poster = $seriesPoster ?: $this->defaultPoster;
+ $banner = $series->primaryBanner?->path ? "storage/{$series->primaryBanner->path}" : $poster;
$isAudio = $folder->isMajorityAudio();
$fileCount = $series->file_count ?? 0;