Skip to content

A self-hosted media server and file management system

chore: lint coding style (pint)

aminnausin3c462bc5e8c9
diff --git a/app/Jobs/EmbedUidInMetadata.php b/app/Jobs/EmbedUidInMetadata.php
index 659a2b81..0cb2708a 100644
--- a/app/Jobs/EmbedUidInMetadata.php
+++ b/app/Jobs/EmbedUidInMetadata.php
@@ -47,7 +47,6 @@ class EmbedUidInMetadata extends ManagedTask {
$summary = $this->handleEmbed();
$task = $this->completeTask($taskService, $summary);
-
if ($this->videoId) {
Video::where('id', $this->videoId)->update(['uuid' => $this->uuid]);
}
diff --git a/app/Jobs/IndexFiles.php b/app/Jobs/IndexFiles.php
index e465bfba..bf471a21 100755
--- a/app/Jobs/IndexFiles.php
+++ b/app/Jobs/IndexFiles.php
@@ -522,5 +522,4 @@ class IndexFiles extends ManagedTask {
return 'Generated ' . $count . ' ' . $type . ' Changes';
}
}
-class BatchCancelledException extends \Exception {
-}
+class BatchCancelledException extends \Exception {}
diff --git a/app/Jobs/ManagedTask.php b/app/Jobs/ManagedTask.php
index 22ccbc2d..d06f3396 100644
--- a/app/Jobs/ManagedTask.php
+++ b/app/Jobs/ManagedTask.php
@@ -36,11 +36,11 @@ abstract class ManagedTask implements ShouldQueue {
* Sets subtask starting summary
*/
public function beginTask(TaskService $taskService, string $summary = ''): void {
- if (!$this->taskId) {
+ if (! $this->taskId) {
throw new LogicException('Task ID missing, cannot begin task');
}
- if (!$this->subTaskId) {
+ if (! $this->subTaskId) {
throw new LogicException('SubTask ID missing, cannot begin task');
}
@@ -68,11 +68,11 @@ abstract class ManagedTask implements ShouldQueue {
$duration = $this->getTaskDuration($endedAt);
$subTaskUpdates = [
- 'status' => TaskStatus::COMPLETED,
- 'summary' => $summary,
- 'progress' => 100,
- 'ended_at' => $endedAt,
- 'duration' => $duration,
+ 'status' => TaskStatus::COMPLETED,
+ 'summary' => $summary,
+ 'progress' => 100,
+ 'ended_at' => $endedAt,
+ 'duration' => $duration,
];
DB::transaction(function () use ($taskService, $taskCountUpdates, $shouldBroadcastTaskUpdate, $subTaskUpdates) {
@@ -96,6 +96,7 @@ abstract class ManagedTask implements ShouldQueue {
private function getTaskDuration(Carbon $endedAt): int {
$startedAt = $this->startedAt ?? $endedAt;
+
return (int) $startedAt->diffInSeconds($endedAt);
}
}