Skip to content

A self-hosted media server and file management system

chore: lint coding style (pint)

aminnausin5610ad382123
diff --git a/app/Http/Controllers/Api/V1/MetadataController.php b/app/Http/Controllers/Api/V1/MetadataController.php
index e8967eab..5bdce765 100644
--- a/app/Http/Controllers/Api/V1/MetadataController.php
+++ b/app/Http/Controllers/Api/V1/MetadataController.php
@@ -74,7 +74,9 @@ class MetadataController extends Controller {
try {
$validated = $request->validated();
- if (empty($metadata->video)) throw new \Exception('Media does not exist');
+ if (empty($metadata->video)) {
+ throw new \Exception('Media does not exist');
+ }
$validated['editor_id'] = Auth::id();
$metadata->update($validated);
@@ -91,7 +93,9 @@ class MetadataController extends Controller {
try {
$validated = $request->validated();
- if (empty($metadata->video)) throw new \Exception('Song does not exist');
+ if (empty($metadata->video)) {
+ throw new \Exception('Song does not exist');
+ }
unset($validated['track']);
diff --git a/database/factories/CategoryFactory.php b/database/factories/CategoryFactory.php
index 90b23346..96c6a4f9 100644
--- a/database/factories/CategoryFactory.php
+++ b/database/factories/CategoryFactory.php
@@ -16,7 +16,7 @@ class CategoryFactory extends Factory {
public function definition(): array {
return [
'name' => $this->faker->word(),
- 'media_content' => false
+ 'media_content' => false,
];
}
}
diff --git a/database/factories/SeriesFactory.php b/database/factories/SeriesFactory.php
index d4978221..73a64b1f 100644
--- a/database/factories/SeriesFactory.php
+++ b/database/factories/SeriesFactory.php
@@ -7,15 +7,13 @@ use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Series>
*/
-class SeriesFactory extends Factory
-{
+class SeriesFactory extends Factory {
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
- public function definition(): array
- {
+ public function definition(): array {
return [
//
];
diff --git a/database/factories/VideoFactory.php b/database/factories/VideoFactory.php
index afc24980..4bb04318 100644
--- a/database/factories/VideoFactory.php
+++ b/database/factories/VideoFactory.php
@@ -19,7 +19,7 @@ class VideoFactory extends Factory {
'folder_id' => Folder::factory(),
'name' => $this->faker->sentence(3),
'path' => $this->faker->unique()->filePath(),
- 'date' => $this->faker->date()
+ 'date' => $this->faker->date(),
];
}
}
diff --git a/linted b/linted
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/Feature/ExternalMetadataControllerTest.php b/tests/Feature/ExternalMetadataControllerTest.php
index a673a55b..5553238d 100644
--- a/tests/Feature/ExternalMetadataControllerTest.php
+++ b/tests/Feature/ExternalMetadataControllerTest.php
@@ -26,7 +26,7 @@ class ExternalMetadataControllerTest extends TestCase {
->assertStatus(200)
->assertJsonStructure([
'lrclib' => ['syncedLyrics'],
- 'payload' => ['track_name', 'artist_name', 'album_name', 'duration']
+ 'payload' => ['track_name', 'artist_name', 'album_name', 'duration'],
]);
}
@@ -43,7 +43,7 @@ class ExternalMetadataControllerTest extends TestCase {
}
public function test_import_fails_for_missing_metadata() {
- $this->getJson("/api/metadata/99999/lyrics/import")
+ $this->getJson('/api/metadata/99999/lyrics/import')
->assertStatus(404);
}
}
diff --git a/tests/Feature/MetadataControllerTest.php b/tests/Feature/MetadataControllerTest.php
index 6043fc50..36932cf7 100644
--- a/tests/Feature/MetadataControllerTest.php
+++ b/tests/Feature/MetadataControllerTest.php
@@ -2,12 +2,10 @@
namespace Tests\Feature;
-use App\Http\Requests\MetadataUpdateRequest;
use App\Models\Metadata;
use App\Models\User;
use App\Models\Video;
use Illuminate\Foundation\Testing\RefreshDatabase;
-use Illuminate\Support\Facades\Auth;
use Tests\TestCase;
class MetadataControllerTest extends TestCase {
@@ -16,6 +14,7 @@ class MetadataControllerTest extends TestCase {
protected function authenticateUser() {
$user = User::factory()->create();
$this->actingAs($user);
+
return $user;
}