1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-23 08:14:10 +00:00

Update TransformImports command, increment status_count on profile model

This commit is contained in:
Daniel Supernault 2023-07-14 01:46:51 -06:00
parent 0b5157675f
commit ba7551d8a9
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -9,6 +9,7 @@ use App\Media;
use App\Profile; use App\Profile;
use App\Status; use App\Status;
use Storage; use Storage;
use App\Services\AccountService;
use App\Services\MediaPathService; use App\Services\MediaPathService;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use App\Util\Lexer\Autolink; use App\Util\Lexer\Autolink;
@ -38,7 +39,7 @@ class TransformImports extends Command
return; return;
} }
$ips = ImportPost::whereNull('status_id')->where('skip_missing_media', '!=', true)->take(200)->get(); $ips = ImportPost::whereNull('status_id')->where('skip_missing_media', '!=', true)->take(500)->get();
if(!$ips->count()) { if(!$ips->count()) {
return; return;
@ -135,6 +136,11 @@ class TransformImports extends Command
$ip->creation_id = $idk['incr']; $ip->creation_id = $idk['incr'];
$ip->save(); $ip->save();
$profile->status_count = $profile->status_count + 1;
$profile->save();
AccountService::del($profile->id);
ImportService::clearAttempts($profile->id); ImportService::clearAttempts($profile->id);
ImportService::getPostCount($profile->id, true); ImportService::getPostCount($profile->id, true);
} }