Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of tests for console commands for pending PR. #1353

Merged
merged 1 commit into from
Jun 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions app/Console/Commands/Takedate.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ class Takedate extends Command
*
* @var string
*/
protected $signature = 'lychee:takedate' .
'{offset=0 : offset of the first photo to process}' .
'{limit=50 : number of photos to process (0 means process all)}' .
'{time=600 : maximum execution time in seconds (0 means unlimited)}' .
'{--c|set-upload-time : additionally sets the upload time based on the creation time of the media file; ATTENTION: this option is rarely needed and potentially harmful}' .
protected $signature = 'lychee:takedate ' .
'{offset=0 : offset of the first photo to process} ' .
'{limit=50 : number of photos to process (0 means process all)} ' .
'{time=600 : maximum execution time in seconds (0 means unlimited)} ' .
'{--c|set-upload-time : additionally sets the upload time based on the creation time of the media file; ATTENTION: this option is rarely needed and potentially harmful} ' .
'{--f|force : force processing of all media files}';

/**
Expand Down
6 changes: 5 additions & 1 deletion app/Console/Commands/VideoData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
use App\Image\MediaFile;
use App\Metadata\Extractor;
use App\Models\Photo;
use App\Models\SizeVariant;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Builder;
use Symfony\Component\Console\Exception\ExceptionInterface as SymfonyConsoleException;

class VideoData extends Command
Expand Down Expand Up @@ -51,7 +53,9 @@ public function handle(): int
$photos = Photo::query()
->with(['size_variants'])
->whereIn('type', MediaFile::SUPPORTED_VIDEO_MIME_TYPES)
->where('width', '=', 0)
->whereDoesntHave('size_variants', function (Builder $query) {
$query->where('type', '=', SizeVariant::THUMB);
})
->take($this->argument('count'))
->get();

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"fideloper/proxy": "^4.3",
"geocoder-php/cache-provider": "^4.3",
"geocoder-php/nominatim-provider": "^5.5",
"laravel/framework": "^8.0",
"laravel/framework": "^8.83.14",
"livewire/livewire": "^2.7",
"lychee-org/nestedset": "^6",
"lychee-org/php-exif": "^0.7.5",
Expand All @@ -54,6 +54,7 @@
"friendsofphp/php-cs-fixer": "^3.3",
"itsgoingd/clockwork": "^5.0",
"laravel/homestead": "^v13.2.1",
"mockery/mockery": "^1.5",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9"
},
Expand Down
Loading