Skip to content

A self-hosted media server and file management system

chore: lint coding style (pint)

aminnausin4ef0690b125d
diff --git a/database/migrations/2026_01_26_191740_fix_updated_at_on_series.php b/database/migrations/2026_01_26_191740_fix_updated_at_on_series.php
index 269a023d..5b1b164f 100644
--- a/database/migrations/2026_01_26_191740_fix_updated_at_on_series.php
+++ b/database/migrations/2026_01_26_191740_fix_updated_at_on_series.php
@@ -10,7 +10,6 @@ return new class extends Migration {
*/
public function up(): void {
/**
- *
* Historical data correction
*
* A past bug caused `series.updated_at` to change on every scan
@@ -20,12 +19,10 @@ return new class extends Migration {
*
* Only applies to rows where `editor_id IS NULL` (this labels possible erroneous data)
* Does not change series rows if they have no related videos (media)
- *
*/
-
DB::beginTransaction();
- $rows = DB::update("
+ $rows = DB::update('
UPDATE series s
SET updated_at = COALESCE(v.max_created_at, s.updated_at)
FROM (
@@ -37,7 +34,7 @@ return new class extends Migration {
WHERE v.folder_id = s.folder_id
AND s.editor_id IS NULL
AND s.updated_at > v.max_created_at
- ");
+ ');
Log::info('Series timestamp correction migration executed', [
'rows_affected' => $rows,
diff --git a/database/migrations/2026_01_27_001434_fix_dates_on_metadata.php b/database/migrations/2026_01_27_001434_fix_dates_on_metadata.php
index 3b6d3fcf..9691b49d 100644
--- a/database/migrations/2026_01_27_001434_fix_dates_on_metadata.php
+++ b/database/migrations/2026_01_27_001434_fix_dates_on_metadata.php
@@ -9,9 +9,7 @@ return new class extends Migration {
* Run the migrations.
*/
public function up(): void {
-
/**
- *
* Historical data correction
*
* A past bug set `metadata.created_at` and in some cases `metadata.updated_at` to NULL during scans
@@ -21,14 +19,13 @@ return new class extends Migration {
*
* In addition, backfill updated_at with created_at if empty
*/
-
DB::beginTransaction();
try {
/**
* Backfill created_at from earliest of video.created_at or updated_at
*/
- $backfillWithVideo = DB::update("
+ $backfillWithVideo = DB::update('
UPDATE metadata m
SET created_at = CASE
WHEN m.updated_at IS NOT NULL
@@ -39,28 +36,28 @@ return new class extends Migration {
WHERE m.video_id = v.id
AND m.created_at IS NULL
AND v.created_at IS NOT NULL
- ");
+ ');
/**
* Backfill created_at from updated_at when no video exists
*/
- $backfillWithoutVideo = DB::update("
+ $backfillWithoutVideo = DB::update('
UPDATE metadata
SET created_at = updated_at
WHERE video_id IS NULL
AND created_at IS NULL
AND updated_at IS NOT NULL
- ");
+ ');
/**
* Backfill updated_at from created_at
*/
- $backfillUpdatedAt = DB::update("
+ $backfillUpdatedAt = DB::update('
UPDATE metadata
SET updated_at = created_at
WHERE updated_at IS NULL
AND created_at IS NOT NULL;
- ");
+ ');
Log::info('Metadata timestamp correction migration executed', [
'rows_affected' => $backfillWithVideo + $backfillWithoutVideo + $backfillUpdatedAt,