A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
chore: code cleanup
aminnausinfd49ebcbe16d
diff --git a/.env.example b/.env.exampleindex 664e914e..fe4b9bd1 100755--- a/.env.example+++ b/.env.example@@ -102,3 +102,5 @@ PLAUSIBLE_SCRIPT_URL=PLAUSIBLE_DOMAIN=PLAUSIBLE_SITE_ID="${APP_HOST}"PLAUSIBLE_API_TOKEN=++VITE_LOGIN_MESSAGE=diff --git a/.gitignore b/.gitignoreindex 3af99626..3c29c689 100755--- a/.gitignore+++ b/.gitignore@@ -39,3 +39,4 @@ data/posters/*install.sh/coverage/database/schema+/database/dumpdiff --git a/app/Services/FileJobService.php b/app/Services/FileJobService.phpindex daac5b65..c82ef406 100644--- a/app/Services/FileJobService.php+++ b/app/Services/FileJobService.php@@ -20,16 +20,17 @@ use Illuminate\Support\Facades\Bus;use Illuminate\Support\Facades\Log;class FileJobService {- public function __construct(protected TaskService $taskService) {}+ public function __construct(protected TaskService $taskService) {+ }public function scanFiles(array $data, ?Category $category = null) {$name = 'Scan Files';- $description = 'Scans for file changes and loads metadata from all Libraries.';+ $description = 'Scans for file changes and loads metadata from all libraries.';$categoryId = null;if (isset($category)) {- $name .= " from the Library \"$category->name\"";- $description = "Scans for file changes and loads metadata from the specified Library \"$category->name\"";+ $name .= " from the library \"$category->name\"";+ $description = "Scans for file changes and loads metadata from the specified library \"$category->name\"";$categoryId = $category->id;}@@ -52,11 +53,11 @@ class FileJobService {public function indexFiles(array $data, ?Category $category = null) {$name = 'Index Files';- $description = 'Looks for folder and video changes in in all Libraries.';+ $description = 'Looks for folder and video changes in in all libraries.';if (isset($category)) {- $name .= " for Library $category->name";- $description = "Looks for folder and video changes in the specified Library $category->name";+ $name .= " for library $category->name";+ $description = "Looks for folder and video changes in the specified library $category->name";}return $this->executeBatchOperation(@@ -87,11 +88,10 @@ class FileJobService {public function verifyFiles(array $data, ?Category $category = null, ?int $taskId = null) {$name = 'Verify Files';- $description = 'Verifies folder and video metadata for all Libraries.';-+ $description = 'Verifies folder and video metadata for all libraries.';if (isset($category)) {- $name .= " for Library \"$category->name\"";- $description = "Verifies folder and video metadata for the specified Library \"$category->name\"";+ $name .= " for library \"$category->name\"";+ $description = "Verifies folder and video metadata for the specified library \"$category->name\"";}return $this->executeBatchOperation(@@ -130,11 +130,11 @@ class FileJobService {public function verifyFolders(array $data, ?Category $category = null) {$name = 'Verify Folders';- $description = 'Verifies folder metadata for all Libraries.';+ $description = 'Verifies folder metadata for all libraries.';if (isset($category)) {- $name .= " for Library \"$category->name\"";- $description = "Verifies folder metadata for the specified Library \"$category->name\"";+ $name .= " for library \"$category->name\"";+ $description = "Verifies folder metadata for the specified library \"$category->name\"";}return $this->executeBatchOperation(@@ -146,7 +146,7 @@ class FileJobService {$query = Folder::orderBy('id');if ($category) {- $query->whereHas('category', fn ($q) => $q->where('id', $category->id))+ $query->whereHas('category', fn($q) => $q->where('id', $category->id))->with('category');}@@ -161,7 +161,7 @@ class FileJobService {public function cleanPaths(array $data) {$name = 'Clean Paths';- $description = 'Cleans file and folder paths for all Libraries.';+ $description = 'Cleans file and folder paths for all libraries.';return $this->executeBatchOperation(userId: $data['userId'] ?? null,@@ -286,9 +286,9 @@ class FileJobService {public function setupBatch(array $chain, Task $task, ?callable $callback = null, ?array $taskData = []) {return Bus::batch($chain)- ->catch(fn (Batch $batch, \Throwable $e) => $this->handleOperationFailure($task, $e))- ->finally(fn (Batch $batch) => $this->finalizeBatch($batch, $task, $callback))- ->before(fn (Batch $batch) => $this->taskService->updateTask($task->id, array_merge([+ ->catch(fn(Batch $batch, \Throwable $e) => $this->handleOperationFailure($task, $e))+ ->finally(fn(Batch $batch) => $this->finalizeBatch($batch, $task, $callback))+ ->before(fn(Batch $batch) => $this->taskService->updateTask($task->id, array_merge(['status' => TaskStatus::PROCESSING,'started_at' => $task->started_at ?? now(),'batch_id' => $batch->id,diff --git a/resources/js/components/dashboard/DashboardActivity.vue b/resources/js/components/dashboard/DashboardActivity.vueindex 8f0cad1f..36120b8a 100644--- a/resources/js/components/dashboard/DashboardActivity.vue+++ b/resources/js/components/dashboard/DashboardActivity.vue@@ -67,6 +67,7 @@ const handleSearch = (query: string) => {<template #icon><ProiconsArrowSync /></template></ButtonText></div>+ <span class="hidden lg:col-span-3"></span></div><TableBase:use-grid="'grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5 gap-3'"diff --git a/resources/js/components/dashboard/DashboardAnalytics.vue b/resources/js/components/dashboard/DashboardAnalytics.vueindex 88f64366..2dcca5bf 100644--- a/resources/js/components/dashboard/DashboardAnalytics.vue+++ b/resources/js/components/dashboard/DashboardAnalytics.vue@@ -120,7 +120,7 @@ watch(<PulseSlowJobs v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" /><PulseSlowQueries v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" /><PulseCache v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" />- <PulseExceptions :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" />- <PulseSlowOutgoingRequests v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" />+ <PulseExceptions :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" />+ <PulseSlowOutgoingRequests v-if="pulseData" :pulse-data="pulseData" :is-loading="pulseLoading" :period="period" :rows="2" :cols="3" /></span></template>