1
0
Fork 0
forked from mirror/pixelfed

Update ImportInstagram pipeline

This commit is contained in:
Daniel Supernault 2020-05-25 21:27:31 -06:00
parent 3df3c474b7
commit 776cd4398b
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -11,7 +11,6 @@ use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Foundation\Bus\Dispatchable;
use App\Jobs\ImageOptimizePipeline\ImageOptimize; use App\Jobs\ImageOptimizePipeline\ImageOptimize;
use App\Jobs\StatusPipeline\NewStatusPipeline;
use App\{ use App\{
ImportJob, ImportJob,
ImportData, ImportData,
@ -56,11 +55,12 @@ class ImportInstagram implements ShouldQueue
$job = ImportJob::findOrFail($this->import->id); $job = ImportJob::findOrFail($this->import->id);
$profile = Profile::findOrFail($job->profile_id); $profile = Profile::findOrFail($job->profile_id);
$user = $profile->user;
$json = $job->mediaJson(); $json = $job->mediaJson();
$collection = $json['photos']; $collection = array_reverse($json['photos']);
$files = $job->files; $files = $job->files;
$monthHash = hash('sha1', date('Y').date('m')); $monthHash = hash('sha1', date('Y').date('m'));
$userHash = hash('sha1', $profile->id . (string) $profile->created_at); $userHash = hash('sha1', $user->id . (string) $user->created_at);
$fs = new Filesystem; $fs = new Filesystem;
foreach($collection as $import) foreach($collection as $import)
@ -118,7 +118,6 @@ class ImportInstagram implements ShouldQueue
$media->order = 1; $media->order = 1;
$media->save(); $media->save();
ImageOptimize::dispatch($media); ImageOptimize::dispatch($media);
NewStatusPipeline::dispatch($status);
}); });
} }