Skip to content

A self-hosted media server and file management system

fix: folders do not support privacy filter

aminnausinfd4e23870043
diff --git a/app/Services/PathResolverService.php b/app/Services/PathResolverService.php
index d77601fc..7057c8ce 100644
--- a/app/Services/PathResolverService.php
+++ b/app/Services/PathResolverService.php
@@ -38,10 +38,9 @@ class PathResolverService {
->select(...$select)->find((int) $identifier);
}
- public function resolveFolder(string $identifier, Category $category, ?Collection $folders = null, bool $onlyPublic = false): ?Folder {
+ public function resolveFolder(string $identifier, Category $category, ?Collection $folders = null): ?Folder {
if (! $folders) {
- $query = Folder::with('series')->where('category_id', $category->id);
- $folders = $this->addPrivacyFilter($query, $onlyPublic)->get();
+ $folders = Folder::with('series')->where('category_id', $category->id)->get();
}
return $this->firstSuccessful([
diff --git a/app/Services/PreviewGeneratorService.php b/app/Services/PreviewGeneratorService.php
index 5a2a4d5c..1dd40f91 100644
--- a/app/Services/PreviewGeneratorService.php
+++ b/app/Services/PreviewGeneratorService.php
@@ -52,7 +52,7 @@ class PreviewGeneratorService {
$viewData = $this->preparePreviewData($this->buildMediaPreviewData($metadata, $request), $metadata, $generateRawPreview);
} else {
$category = $this->pathResolver->resolveCategory($categorySlug, ! Gate::allows('admin'));
- $folder = $this->pathResolver->resolveFolder(identifier: $folderSlug, category: $category, onlyPublic: ! Gate::allows('admin'))->load('series.primaryPoster', 'series.folderTags');
+ $folder = $this->pathResolver->resolveFolder(identifier: $folderSlug, category: $category)->load('series.primaryPoster', 'series.folderTags');
$viewData = $this->preparePreviewData($this->buildFolderPreviewData($category, $folder, $request), $folder->series, $generateRawPreview);
}