Skip to content

Commit

Permalink
Add comments and apply minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lehecht committed Oct 17, 2024
1 parent b3732e2 commit 42810dc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/Jobs/CloneImageThumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ class CloneImageThumbnails extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;

/**
* Path of original image thumbnails and tiled data
* @var string
*/
public $prefix;

/**
* Path of cloned image thumbnails and tiled data
* @var string
*/
public $copyPrefix;

public function __construct(String $prefix, String $copyPrefix)
Expand Down
8 changes: 8 additions & 0 deletions app/Jobs/CloneVideoThumbnails.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ class CloneVideoThumbnails extends Job implements ShouldQueue
{
use InteractsWithQueue, SerializesModels;

/**
* Path of original video thumbnails and sprites
* @var string
*/
public $prefix;

/**
* Path of cloned video thumbnails and sprites
* @var string
*/
public $copyPrefix;

public function __construct(String $prefix, String $copyPrefix)
Expand Down
3 changes: 2 additions & 1 deletion app/Jobs/ProcessNewVolumeFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ function (Video $video) use ($queue) {
$copyPrefix = fragment_uuid_path($video->uuid);

$nbrFiles = count(Storage::disk(config('videos.thumbnail_storage_disk'))->files($prefix));
$nbrSprites = count(array_filter(Storage::disk(config('videos.thumbnail_storage_disk'))->files($prefix), fn ($f) => str_contains($f, 'sprite')));
$nbrSprites = count(array_filter(Storage::disk(config('videos.thumbnail_storage_disk'))
->files($prefix), fn ($f) => str_contains($f, 'sprite')));

$hasThumbnails = $nbrFiles - $nbrSprites > 0;
$hasSprites = $nbrSprites > 0;
Expand Down

0 comments on commit 42810dc

Please sign in to comment.