mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-26 06:53:17 +00:00
Update MediaStorageService
This commit is contained in:
parent
d6374cfe70
commit
e8d4ce1888
2 changed files with 9 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue