|
|
|
|
@ -6,6 +6,7 @@ use App\ImportData;
|
|
|
|
|
use App\ImportJob;
|
|
|
|
|
use App\Jobs\ImportPipeline\ImportInstagram;
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
@ -26,7 +27,7 @@ trait Instagram
|
|
|
|
|
if ((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
|
|
|
|
|
abort(404, 'Feature not enabled');
|
|
|
|
|
}
|
|
|
|
|
$completed = ImportJob::whereProfileId($request->user()->profile->id)
|
|
|
|
|
$completed = ImportJob::whereProfileId(Auth::user()->profile->id)
|
|
|
|
|
->whereService('instagram')
|
|
|
|
|
->whereNotNull('completed_at')
|
|
|
|
|
->exists();
|
|
|
|
|
@ -43,7 +44,7 @@ trait Instagram
|
|
|
|
|
if ((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
|
|
|
|
|
abort(404, 'Feature not enabled');
|
|
|
|
|
}
|
|
|
|
|
$profile = request()->user()->profile;
|
|
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
$exists = ImportJob::whereProfileId($profile->id)
|
|
|
|
|
->whereService('instagram')
|
|
|
|
|
->whereNull('completed_at')
|
|
|
|
|
@ -70,7 +71,7 @@ trait Instagram
|
|
|
|
|
if ((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
|
|
|
|
|
abort(404, 'Feature not enabled');
|
|
|
|
|
}
|
|
|
|
|
$profile = $request->user()->profile;
|
|
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
$job = ImportJob::whereProfileId($profile->id)
|
|
|
|
|
->whereNull('completed_at')
|
|
|
|
|
->whereUuid($uuid)
|
|
|
|
|
@ -92,7 +93,7 @@ trait Instagram
|
|
|
|
|
]);
|
|
|
|
|
$media = $request->file('media');
|
|
|
|
|
|
|
|
|
|
$profile = $request->user()->profile;
|
|
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
$job = ImportJob::whereProfileId($profile->id)
|
|
|
|
|
->whereNull('completed_at')
|
|
|
|
|
->whereUuid($uuid)
|
|
|
|
|
@ -131,7 +132,7 @@ trait Instagram
|
|
|
|
|
if ((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
|
|
|
|
|
abort(404, 'Feature not enabled');
|
|
|
|
|
}
|
|
|
|
|
$profile = $request->user()->profile;
|
|
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
$job = ImportJob::whereProfileId($profile->id)
|
|
|
|
|
->whereNull('completed_at')
|
|
|
|
|
->whereUuid($uuid)
|
|
|
|
|
@ -149,7 +150,7 @@ trait Instagram
|
|
|
|
|
$this->validate($request, [
|
|
|
|
|
'media' => 'required|file|max:1000',
|
|
|
|
|
]);
|
|
|
|
|
$profile = $request->user()->profile;
|
|
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
$job = ImportJob::whereProfileId($profile->id)
|
|
|
|
|
->whereNull('completed_at')
|
|
|
|
|
->whereUuid($uuid)
|
|
|
|
|
@ -175,7 +176,7 @@ trait Instagram
|
|
|
|
|
if ((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
|
|
|
|
|
abort(404, 'Feature not enabled');
|
|
|
|
|
}
|
|
|
|
|
$profile = $request->user()->profile;
|
|
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
$job = ImportJob::whereProfileId($profile->id)
|
|
|
|
|
->whereService('instagram')
|
|
|
|
|
->whereNull('completed_at')
|
|
|
|
|
@ -191,7 +192,7 @@ trait Instagram
|
|
|
|
|
if ((bool) config_cache('pixelfed.import.instagram.enabled') != true) {
|
|
|
|
|
abort(404, 'Feature not enabled');
|
|
|
|
|
}
|
|
|
|
|
$profile = $request->user()->profile;
|
|
|
|
|
$profile = Auth::user()->profile;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
$import = ImportJob::whereProfileId($profile->id)
|
|
|
|
|
|