Update MediaStorageService

This commit is contained in:
Daniel Supernault 2023-06-06 06:01:49 -06:00
parent d6374cfe70
commit e8d4ce1888
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 9 additions and 1 deletions

View file

@ -13,9 +13,11 @@ use App\Util\ActivityPub\Helpers;
use Illuminate\Support\Str;
use Zttp\Zttp;
use App\Http\Controllers\AvatarController;
use Cache;
use Storage;
use Log;
use Illuminate\Http\File;
use App\Services\AccountService;
use App\Services\MediaStorageService;
use App\Services\ActivityPubFetchService;
@ -84,6 +86,9 @@ class RemoteAvatarFetchFromUrl implements ShouldQueue
$avatar->save();
}
Cache::forget('avatar:' . $avatar->profile_id);
AccountService::del($avatar->profile_id);
MediaStorageService::avatar($avatar, boolval(config_cache('pixelfed.cloud_storage')) == false, true);
return 1;

View file

@ -221,6 +221,9 @@ class MediaStorageService {
}
}
Cache::forget('avatar:' . $avatar->profile_id);
AccountService::del($avatar->profile_id);
// handle pleroma edge case
if(Str::endsWith($mime, '; charset=utf-8')) {
$mime = str_replace('; charset=utf-8', '', $mime);
@ -268,7 +271,7 @@ class MediaStorageService {
$avatar->save();
Cache::forget('avatar:' . $avatar->profile_id);
Cache::forget(AccountService::CACHE_KEY . $avatar->profile_id);
AccountService::del($avatar->profile_id);
unlink($tmpName);
}