Skip to content

A self-hosted media server and file management system

chore: code smells

aminnausinf5a21892c788
diff --git a/app/Jobs/GeneratePreviewImage.php b/app/Jobs/GeneratePreviewImage.php
index dd869cf2..f9c7e127 100644
--- a/app/Jobs/GeneratePreviewImage.php
+++ b/app/Jobs/GeneratePreviewImage.php
@@ -3,9 +3,9 @@
namespace App\Jobs;
use App\Enums\TaskStatus;
+use App\Services\GenerateImageException;
use App\Services\PreviewGeneratorService;
use App\Services\TaskService;
-use Exception;
use Illuminate\Bus\Batchable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
@@ -59,7 +59,7 @@ class GeneratePreviewImage implements ShouldQueue {
try {
$result = $previewGenerator->generateImage($this->data, $this->path, true);
if (! $result) {
- throw new Exception('Preview image generation failed. View logs for error.');
+ throw new GenerateImageException('Preview image generation failed. View logs for error.');
}
$endedAt = now();
diff --git a/app/Jobs/IndexFiles.php b/app/Jobs/IndexFiles.php
index 24fca038..2784e5e4 100755
--- a/app/Jobs/IndexFiles.php
+++ b/app/Jobs/IndexFiles.php
@@ -78,8 +78,6 @@ class IndexFiles implements ShouldBeUnique, ShouldQueue {
foreach ($this->embedChain as $embedTask) {
$this->batch()->add($embedTask);
}
- // $controller = new JobController($this->taskService);
- // $controller->embedUIDs($this->taskId, "Embed UIDs for task $this->taskId via Index Files", $this->embedChain);
}
$this->taskService->updateTaskCounts($this->taskId, $taskUpdateData, count($taskUpdateData) !== 1);
@@ -490,11 +488,8 @@ class IndexFiles implements ShouldBeUnique, ShouldQueue {
$embeddingUuid = false;
if (! $uuid || ! Uuid::isValid($uuid)) {
$uuid = Str::uuid()->toString();
- // $this->batch()->add(new EmbedUidInMetadata($absolutePath, $uuid, $this->taskId, $currentID));
$this->embedChain[] = new EmbedUidInMetadata($absolutePath, $uuid, $this->taskId, $currentID);
$embeddingUuid = true;
- // $this->embedChain[] = ["path" => $absolutePath, "uid" => $uuid];
- // EmbedUidInMetadata::dispatch($absolutePath, $uuid, $this->taskId);
}
// Dont add uuid to video if embedding job is to be scheduled. This prevents not knowing if the uuid was applied to the video in case a job fails.
diff --git a/resources/js/components/video/VideoInfoPanel.vue b/resources/js/components/video/VideoInfoPanel.vue
index 05f0db6d..7b3ba7ee 100755
--- a/resources/js/components/video/VideoInfoPanel.vue
+++ b/resources/js/components/video/VideoInfoPanel.vue
@@ -153,9 +153,6 @@ watch(
:colour="'bg-neutral-200 leading-none shadow dark:bg-neutral-900 hover:bg-neutral-600 text-neutral-500 hover:text-neutral-50 hover:dark:bg-neutral-600/90 !max-h-[22px] text-xs flex items-center'"
/>
</span>
- <!-- <span v-if="(stateVideo?.video_tags?.length ?? 0) > 0" :class="`flex gap-1 flex-row flex-wrap h-[22px] overflow-clip mr-auto w-full`">
- <ChipTag v-for="(tag, index) in stateVideo?.video_tags" v-bind:key="index" :label="tag.name" />
- </span> -->
</section>
<section id="mp4-folder-info" class="hidden xs:block h-32 my-auto object-cover rounded-md shadow-md aspect-2/3 mb-auto relative group">
<img
diff --git a/resources/js/layouts/LayoutBase.vue b/resources/js/layouts/LayoutBase.vue
index 7b6ec427..56a92156 100755
--- a/resources/js/layouts/LayoutBase.vue
+++ b/resources/js/layouts/LayoutBase.vue
@@ -86,7 +86,7 @@ watch(
<style lang="css">
h1,
h2 {
- font-family: 'Rubik', 'sans-serif';
+ font-family: 'Rubik', sans-serif;
font-weight: 200;
font-optical-sizing: auto;
}
diff --git a/resources/js/service/pulseUtil.ts b/resources/js/service/pulseUtil.ts
index 50a3d33c..d9d5a79e 100644
--- a/resources/js/service/pulseUtil.ts
+++ b/resources/js/service/pulseUtil.ts
@@ -3,14 +3,12 @@ export function getMaxReading(readings: { [key: string]: { [key: string]: string
// const flattenedValues = Object.values(readings).flatMap((reading) => Object.values(reading));
// const numberValues = flattenedValues.map((value) => (value !== null && !isNaN(Number(value)) ? Number(value) : -Infinity));
- const max =
+ return (
Math.max(
...Object.values(readings).map((dataset) => Math.max(...Object.values(dataset).map((value) => (value !== null && !isNaN(Number(value)) ? Number(value) : -Infinity)))),
) *
- (1 / sampleRate);
- // console.log(value);
-
- return max;
+ (1 / sampleRate)
+ );
}
/**