forked from mirror/pixelfed
Merge pull request #3877 from pixelfed/staging
Update AvatarStorage pipeline
This commit is contained in:
commit
38c84e1c3e
|
@ -87,12 +87,12 @@ class AvatarStorage extends Command
|
|||
$this->line(' ');
|
||||
}
|
||||
|
||||
if(config_cache('instance.avatar.local_to_cloud')) {
|
||||
if(config('instance.avatar.local_to_cloud')) {
|
||||
$this->info('✅ - Store avatars on cloud filesystem');
|
||||
$this->line(' ');
|
||||
}
|
||||
|
||||
if(config_cache('pixelfed.cloud_storage') && config_cache('instance.avatar.local_to_cloud')) {
|
||||
if(config_cache('pixelfed.cloud_storage') && config('instance.avatar.local_to_cloud')) {
|
||||
$disk = Storage::disk(config_cache('filesystems.cloud'));
|
||||
$exists = $disk->exists('cache/avatars/default.jpg');
|
||||
$state = $exists ? '✅' : '❌';
|
||||
|
@ -100,7 +100,7 @@ class AvatarStorage extends Command
|
|||
$this->info($msg);
|
||||
}
|
||||
|
||||
$options = config_cache('pixelfed.cloud_storage') && config_cache('instance.avatar.local_to_cloud') ?
|
||||
$options = config_cache('pixelfed.cloud_storage') && config('instance.avatar.local_to_cloud') ?
|
||||
[
|
||||
'Cancel',
|
||||
'Upload default avatar to cloud',
|
||||
|
@ -164,7 +164,7 @@ class AvatarStorage extends Command
|
|||
|
||||
protected function uploadAvatarsToCloud()
|
||||
{
|
||||
if(!config_cache('pixelfed.cloud_storage') || !config_cache('instance.avatar.local_to_cloud')) {
|
||||
if(!config_cache('pixelfed.cloud_storage') || !config('instance.avatar.local_to_cloud')) {
|
||||
$this->error('Enable cloud storage and avatar cloud storage to perform this action');
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ class AvatarOptimize implements ShouldQueue
|
|||
Cache::forget('avatar:' . $avatar->profile_id);
|
||||
$this->deleteOldAvatar($avatar->media_path, $this->current);
|
||||
|
||||
if(config_cache('pixelfed.cloud_storage') && config_cache('instance.avatar.local_to_cloud')) {
|
||||
if(config_cache('pixelfed.cloud_storage') && config('instance.avatar.local_to_cloud')) {
|
||||
$this->uploadToCloud($avatar);
|
||||
} else {
|
||||
$avatar->cdn_url = null;
|
||||
|
|
|
@ -55,6 +55,7 @@ class ConfigCacheService
|
|||
'config.discover.features',
|
||||
|
||||
'instance.has_legal_notice',
|
||||
'instance.avatar.local_to_cloud',
|
||||
|
||||
'pixelfed.directory',
|
||||
'app.banner_image',
|
||||
|
|
Loading…
Reference in New Issue