From 319f0ba50f21cb23277776f389ac0eded5beac7a Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 1 Dec 2022 23:13:44 -0700 Subject: [PATCH] Update MediaStorageService, fix size check bug --- app/Services/MediaStorageService.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Services/MediaStorageService.php b/app/Services/MediaStorageService.php index 1c3272ec1..8dd8319e7 100644 --- a/app/Services/MediaStorageService.php +++ b/app/Services/MediaStorageService.php @@ -12,6 +12,7 @@ use App\Media; use App\Profile; use App\User; use GuzzleHttp\Client; +use App\Services\AccountService; use App\Http\Controllers\AvatarController; use GuzzleHttp\Exception\RequestException; use App\Jobs\MediaPipeline\MediaDeletePipeline; @@ -226,10 +227,6 @@ class MediaStorageService { return; } - if($avatar->size && $head['length'] == $avatar->size) { - return; - } - $base = ($local ? 'public/cache/' : 'cache/') . 'avatars/' . $avatar->profile_id; $ext = $head['mime'] == 'image/jpeg' ? 'jpg' : 'png'; $path = Str::random(20) . '_avatar.' . $ext; @@ -255,6 +252,7 @@ class MediaStorageService { $avatar->save(); Cache::forget('avatar:' . $avatar->profile_id); + Cache::forget(AccountService::CACHE_KEY . $avatar->profile_id); unlink($tmpName); }