Skip to content

Commit 10ad86b

Browse files
committed
WIP
1 parent 3db47d9 commit 10ad86b

File tree

4 files changed

+8
-19
lines changed

4 files changed

+8
-19
lines changed

.github/workflows/run-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: true
1212
matrix:
13-
os: [ubuntu-20.04, windows-2019]
13+
os: [ubuntu-20.04]
1414
php: [8.1, 8.0]
1515
laravel: [9.*]
1616
ffmpeg: [5.0, 4.4]
@@ -35,6 +35,7 @@ jobs:
3535
- name: Install FFmpeg
3636
uses: Iamshankhadeep/setup-ffmpeg@ffmpeg-5.0-20220119
3737
with:
38+
token: ${{ secrets.CI_GITHUB_TOKEN }}
3839
version: ${{ matrix.ffmpeg }}
3940
id: setup-ffmpeg
4041

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ It's the *magic* of Inertia.js with the *simplicity* of Blade. [Splade](https://
2929
* Built-in support for generating *VTT Preview Thumbnail* files.
3030
* Requires PHP 8.0 and 8.1.
3131
* Tested with FFmpeg 4.4 and 5.0.
32-
* Lots of integration tests, GitHub Actions with both Ubuntu and Windows.
3332

3433
## Installation
3534

src/Exporters/VTTPreviewThumbnailsGenerator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private function getTimestamp(int $thumbKey): string
6363
'%02d:%02d:%02d.000',
6464
($thumbKey * $this->tileFilter->interval) / 3600,
6565
($thumbKey * $this->tileFilter->interval) / 60 % 60,
66-
($thumbKey * $this->tileFilter->interval) % 60
66+
($thumbKey * $this->tileFilter->interval) % 60
6767
);
6868
}
6969

@@ -83,7 +83,7 @@ public function getContents(): string
8383
return Collection::range(1, $totalFiles * $thumbsPerTile)
8484
->map(function ($thumb) use ($thumbsPerTile) {
8585
$start = $this->getTimestamp($thumb - 1, $this->tileFilter->interval);
86-
$end = $this->getTimestamp($thumb, $this->tileFilter->interval);
86+
$end = $this->getTimestamp($thumb, $this->tileFilter->interval);
8787

8888
$fileKey = ceil($thumb / $thumbsPerTile);
8989

@@ -93,7 +93,7 @@ public function getContents(): string
9393
);
9494

9595
$positionOnTile = ($thumb - 1) % $thumbsPerTile;
96-
$position = $this->getPositionOnTile($positionOnTile);
96+
$position = $this->getPositionOnTile($positionOnTile);
9797

9898
return implode(PHP_EOL, [
9999
"{$start} --> {$end}",

tests/VTTPreviewThumbnailsGeneratorTest.php

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ class VTTPreviewThumbnailsGeneratorTest extends TestCase
1010
{
1111
use MatchesSnapshots;
1212

13-
private function updateWindowsNewLines($content)
14-
{
15-
if (!windows_os()) {
16-
return $content;
17-
}
18-
19-
$content = str_replace("\r\n", "\n", $content);
20-
$content = str_replace("\n", "\r\n", $content);
21-
22-
return $content;
23-
}
2413

2514
/** @test */
2615
public function it_can_generate_a_vtt_file()
@@ -34,7 +23,7 @@ public function it_can_generate_a_vtt_file()
3423

3524
$generator = new VTTPreviewThumbnailsGenerator($tile, 250, fn () => "sprite_%d.jpg");
3625

37-
$this->assertMatchesTextSnapshot($this->updateWindowsNewLines($generator->getContents()));
26+
$this->assertMatchesTextSnapshot($generator->getContents());
3827
}
3928

4029
/** @test */
@@ -51,7 +40,7 @@ public function it_can_generate_a_vtt_file_with_a_non_sqaure_grid()
5140
return "sprite_{$i}.jpg";
5241
});
5342

54-
$this->assertMatchesTextSnapshot($this->updateWindowsNewLines($generator->getContents()));
43+
$this->assertMatchesTextSnapshot($generator->getContents());
5544
}
5645

5746
/** @test */
@@ -70,6 +59,6 @@ public function it_can_generate_a_vtt_file_and_keep_the_margin_and_padding_in_ac
7059
return "sprite_{$i}.jpg";
7160
});
7261

73-
$this->assertMatchesTextSnapshot($this->updateWindowsNewLines($generator->getContents()));
62+
$this->assertMatchesTextSnapshot($generator->getContents());
7463
}
7564
}

0 commit comments

Comments
 (0)