Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
christophrumpel committed Jun 5, 2024
2 parents ad48a10 + d78903d commit 1cf45c3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/CheckIfUpcomingStreamsAreLiveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function handle(): int
->where('scheduled_start_time', '<=', now()->addMinutes(30))
->get()
->keyBy('youtube_id');

if ($streams->isEmpty()) {
$this->info('There are no streams to update.');

Expand All @@ -31,15 +31,15 @@ public function handle(): int
$this->info("Fetching {$streams->count()} stream(s) from API to update their status.");

$updatesCount = YouTube::videos($streams->keys())
->map(fn(StreamData $streamData) => optional($streams
->map(fn (StreamData $streamData) => optional($streams
->get($streamData->videoId))
->update([
'status' => $streamData->status,
]))
->filter()
->count();

$this->info($updatesCount . ' stream(s) were updated.');
$this->info($updatesCount.' stream(s) were updated.');

return self::SUCCESS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use App\Models\Stream;
use Illuminate\Support\Facades\Http;

it('updates upcoming streams that are soon live', function () {
it('updates upcoming streams that are soon live', function() {
// Arrange
Http::fake();

Expand All @@ -18,7 +18,7 @@
->assertExitCode(0);
});

it('does not update finished or live streams', function () {
it('does not update finished or live streams', function() {
// Arrange
Http::fake();
Stream::factory()->live()->create();
Expand All @@ -30,7 +30,7 @@
->assertExitCode(0);
});

it('does not update unapproved streams', function () {
it('does not update unapproved streams', function() {
// Arrange
Http::fake();

Expand Down
10 changes: 5 additions & 5 deletions tests/Feature/PagesResponseTest.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<?php

it('can show the home page', function () {
it('can show the home page', function() {
$this->get(route('home'))
->assertOk();
});

it('can show the feed', function () {
it('can show the feed', function() {
$this->get('/feed')
->assertOk();
});

it('can show the archive', function () {
it('can show the archive', function() {
$this->get(route('archive'))
->assertOk();
});

it('can show the calendar page', function () {
it('can show the calendar page', function() {
$this->withoutExceptionHandling();
$this->get(route('calendar.ics'))
->assertOk();
});

it('can privacy policy page', function () {
it('can privacy policy page', function() {
$this->get(route('privacy.policy'))
->assertOk();
});

0 comments on commit 1cf45c3

Please sign in to comment.