some progress
This commit is contained in:
@@ -56,12 +56,15 @@ class FetchExportCommand extends Command
|
||||
|
||||
private function downloadFile($url, $path): void
|
||||
{
|
||||
echo "Downloading file at ".$url."\n";
|
||||
$newFileName = $path;
|
||||
$file = fopen ($url, 'rb');
|
||||
$newFile = null;
|
||||
if ($file) {
|
||||
echo "Starting download ".$url."\n";
|
||||
$newFile = fopen ($newFileName, 'wb');
|
||||
if ($newFile) {
|
||||
echo "in progress ".$url."\n";
|
||||
while(!feof($file)) {
|
||||
fwrite($newFile, fread($file, 1024 * 8), 1024 * 8);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class FetchExportItemsCommand extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Fetch TMDB items from export file. Types: movie/show';
|
||||
protected $description = 'Fetch TMDB items from export file. Types: movie/tv_series';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -42,7 +42,7 @@ class FetchExportItemsCommand extends Command
|
||||
$path = storage_path('/'.$type."*");
|
||||
$file = glob($path);
|
||||
|
||||
return reset($file);
|
||||
return end($file);
|
||||
}
|
||||
|
||||
private function processItems($gzOpenedFile, string $type)
|
||||
|
||||
Reference in New Issue
Block a user