kopia lustrzana https://github.com/pixelfed/pixelfed
				
				
				
			Update MediaStorageService
							rodzic
							
								
									d6374cfe70
								
							
						
					
					
						commit
						e8d4ce1888
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue