Update AvatarStorage pipeline

This commit is contained in:
Daniel Supernault 2022-12-02 01:36:23 -07:00
parent 252748ab23
commit d52ee26dd7
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
3 changed files with 6 additions and 5 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -55,6 +55,7 @@ class ConfigCacheService
'config.discover.features',
'instance.has_legal_notice',
'instance.avatar.local_to_cloud',
'pixelfed.directory',
'app.banner_image',