A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
chore: pint
aminnausin3497bef55f1f
diff --git a/app/Services/Images/ImageDownloadService.php b/app/Services/Images/ImageDownloadService.phpindex 6d5fca28..8de7764d 100644--- a/app/Services/Images/ImageDownloadService.php+++ b/app/Services/Images/ImageDownloadService.php@@ -8,8 +8,6 @@ use Illuminate\Support\Facades\Log;use Illuminate\Support\Facades\Storage;class ImageDownloadService {- public function __construct() {}-// TODO: Eventually use this service with DI in verifyFiles and verifyFolders to download thumbnail urls ... currently using static function in verifyFolderspublic function importExternalImageAsURL($url, $compositePath) {try {diff --git a/resources/js/service/__test__/generateStoryboardCues.test.ts b/resources/js/service/__test__/generateStoryboardCues.test.tsindex 27c3ff40..f9f18812 100644--- a/resources/js/service/__test__/generateStoryboardCues.test.ts+++ b/resources/js/service/__test__/generateStoryboardCues.test.ts@@ -28,7 +28,7 @@ describe('buildStoryboardCues', () => {it('last cue end does not exceed duration', () => {const cues = buildStoryboardCues(UUID, 95, makeStoryboard());- expect(cues[cues.length - 1].end).toBeLessThanOrEqual(95);+ expect(cues.at(-1)?.end).toBeLessThanOrEqual(95);});it('first tile has x=0 y=0', () => {diff --git a/tests/Unit/Services/FFmpeg/FFmpegCommandBuilderTest.php b/tests/Unit/Services/FFmpeg/FFmpegCommandBuilderTest.phpindex 53fb4e12..c9e0a29b 100644--- a/tests/Unit/Services/FFmpeg/FFmpegCommandBuilderTest.php+++ b/tests/Unit/Services/FFmpeg/FFmpegCommandBuilderTest.php@@ -10,6 +10,10 @@ use App\Services\Images\Storyboard\StoryboardOptions;use Tests\TestCase;class FFmpegCommandBuilderTest extends TestCase {+ const INPUT_PATH = '/input.mkv';++ const OUTPUT_PATH = '/output/%d.jpg';+private function makeBuilder(HardwareType $type): FFmpegCommandBuilder {$profile = new HardwareProfile(cuda: $type === HardwareType::CUDA,@@ -38,7 +42,7 @@ class FFmpegCommandBuilderTest extends TestCase {}public function test_cpu_command_has_no_hwaccel(): void {- $command = $this->makeBuilder(HardwareType::CPU)->storyboard('/input.mkv', '/output/%d.jpg', $this->makeOptions());+ $command = $this->makeBuilder(HardwareType::CPU)->storyboard(self::INPUT_PATH, self::OUTPUT_PATH, $this->makeOptions());$this->assertNotContains('-hwaccel', $command);$this->assertContains('mjpeg', $command);@@ -46,7 +50,7 @@ class FFmpegCommandBuilderTest extends TestCase {public function test_cuda_command_has_hwaccel(): void {$command = $this->makeBuilder(HardwareType::CUDA)- ->storyboard('/input.mkv', '/output/%d.jpg', $this->makeOptions());+ ->storyboard(self::INPUT_PATH, self::OUTPUT_PATH, $this->makeOptions());$this->assertContains('-hwaccel', $command);$this->assertContains('cuda', $command);@@ -54,7 +58,7 @@ class FFmpegCommandBuilderTest extends TestCase {public function test_qsv_command_uses_mjpeg_qsv_encoder(): void {$command = $this->makeBuilder(HardwareType::QSV)- ->storyboard('/input.mkv', '/output/%d.jpg', $this->makeOptions());+ ->storyboard(self::INPUT_PATH, self::OUTPUT_PATH, $this->makeOptions());$this->assertContains('mjpeg_qsv', $command);$this->assertContains('-global_quality:v', $command);@@ -63,7 +67,7 @@ class FFmpegCommandBuilderTest extends TestCase {public function test_command_contains_skip_frame_nokey(): void {$command = $this->makeBuilder(HardwareType::CPU)- ->storyboard('/input.mkv', '/output/%d.jpg', $this->makeOptions());+ ->storyboard(self::INPUT_PATH, self::OUTPUT_PATH, $this->makeOptions());$this->assertContains('-skip_frame', $command);$this->assertContains('nokey', $command);@@ -71,7 +75,7 @@ class FFmpegCommandBuilderTest extends TestCase {public function test_command_contains_correct_fps(): void {$command = $this->makeBuilder(HardwareType::CPU)- ->storyboard('/input.mkv', '/output/%d.jpg', $this->makeOptions());+ ->storyboard(self::INPUT_PATH, self::OUTPUT_PATH, $this->makeOptions());$vfIndex = array_search('-vf', $command);$this->assertStringContainsString('fps=0.1', $command[$vfIndex + 1]);@@ -79,7 +83,7 @@ class FFmpegCommandBuilderTest extends TestCase {public function test_command_contains_tile_filter(): void {$command = $this->makeBuilder(HardwareType::CPU)- ->storyboard('/input.mkv', '/output/%d.jpg', $this->makeOptions());+ ->storyboard(self::INPUT_PATH, self::OUTPUT_PATH, $this->makeOptions());$vfIndex = array_search('-vf', $command);$this->assertStringContainsString('tile=10x10', $command[$vfIndex + 1]);diff --git a/tests/Unit/Services/Images/StoryboardOptionsTest.php b/tests/Unit/Services/Images/StoryboardOptionsTest.phpindex 1e3fa1a7..c54ce049 100644--- a/tests/Unit/Services/Images/StoryboardOptionsTest.php+++ b/tests/Unit/Services/Images/StoryboardOptionsTest.php@@ -8,13 +8,15 @@ use App\Services\Images\Storyboard\StoryboardOptions;use Tests\TestCase;class StoryboardOptionsTest extends TestCase {+ const VIDEO_MIME_TYPE = 'video/mp4';+public function test_landscape_video_gets_correct_dimensions(): void {$metadata = Metadata::factory()->make(['codec' => 'h264','duration' => 600,'resolution_width' => 1920,'resolution_height' => 1080,- 'mime_type' => 'video/mp4',+ 'mime_type' => self::VIDEO_MIME_TYPE,]);$options = StoryboardOptions::fromMetadata($metadata);@@ -29,7 +31,7 @@ class StoryboardOptionsTest extends TestCase {'duration' => 600,'resolution_width' => 1080,'resolution_height' => 1920,- 'mime_type' => 'video/mp4',+ 'mime_type' => self::VIDEO_MIME_TYPE,]);$options = StoryboardOptions::fromMetadata($metadata);@@ -51,7 +53,7 @@ class StoryboardOptionsTest extends TestCase {'duration' => 16,'resolution_width' => 1920,'resolution_height' => 1080,- 'mime_type' => 'video/mp4',+ 'mime_type' => self::VIDEO_MIME_TYPE,]);$options = StoryboardOptions::fromMetadata($metadata);