Skip to content

Commit

Permalink
Fix 1311
Browse files Browse the repository at this point in the history
  • Loading branch information
nagmat84 committed May 9, 2022
1 parent 1344cb4 commit 2848e96
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/Actions/Import/Exec.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,7 @@ public function do(

// TODO: Consider to use a modern OO-approach using [`DirectoryIterator`](https://www.php.net/manual/en/class.directoryiterator.php) and [`SplFileInfo`](https://www.php.net/manual/en/class.splfileinfo.php)
/** @var string[] $files */
$files = glob($path . '/*');
if ($files === false) {
throw new FileOperationException('Could not list directory entries (' . $path . ')');
}
$files = \Safe\glob($path . '/*');

$filesTotal = count($files);
$filesCount = 0;
Expand Down Expand Up @@ -308,7 +305,7 @@ public function do(
Album::query()
->select(['albums.*'])
->join('base_albums', 'base_albums.id', '=', 'albums.id')
->where('albums.parent_id', '=', $parentAlbum->id)
->where('albums.parent_id', '=', $parentAlbum?->id)
->where('base_albums.title', '=', basename($dir))
->get()
->first() :
Expand Down

0 comments on commit 2848e96

Please sign in to comment.