Update config() to config_cache()

This commit is contained in:
Daniel Supernault 2021-05-18 22:45:04 -06:00
parent e8f15b6fa1
commit 41792eea56
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
5 changed files with 11 additions and 11 deletions

View file

@ -646,7 +646,7 @@ class ComposeController extends Controller
case 'image/jpeg':
case 'image/png':
case 'video/mp4':
$finished = config('pixelfed.cloud_storage') ? (bool) $media->cdn_url : (bool) $media->processed_at;
$finished = config_cache('pixelfed.cloud_storage') ? (bool) $media->cdn_url : (bool) $media->processed_at;
break;
default:

View file

@ -51,7 +51,7 @@ class RemoteAvatarFetch implements ShouldQueue
{
$profile = $this->profile;
if(config('pixelfed.cloud_storage') !== true) {
if(config_cache('pixelfed.cloud_storage') !== true) {
return 1;
}
@ -75,7 +75,7 @@ class RemoteAvatarFetch implements ShouldQueue
return 1;
}
if( !isset($person['icon']) ||
if( !isset($person['icon']) ||
!isset($person['icon']['type']) ||
!isset($person['icon']['url'])
) {
@ -99,4 +99,4 @@ class RemoteAvatarFetch implements ShouldQueue
return 1;
}
}
}

View file

@ -27,7 +27,7 @@ class MediaDeletePipeline implements ShouldQueue
$media = $this->media;
$path = $media->media_path;
$thumb = $media->thumbnail_path;
if(!$path) {
return 1;
}
@ -36,7 +36,7 @@ class MediaDeletePipeline implements ShouldQueue
array_pop($e);
$i = implode('/', $e);
if(config('pixelfed.cloud_storage') == true) {
if(config_cache('pixelfed.cloud_storage') == true) {
$disk = Storage::disk(config('filesystems.cloud'));
if($disk->exists($path)) {
$disk->delete($path);
@ -64,4 +64,4 @@ class MediaDeletePipeline implements ShouldQueue
return 1;
}
}
}

View file

@ -20,7 +20,7 @@ class MediaStorageService {
public static function store(Media $media)
{
if(config('pixelfed.cloud_storage') == true) {
if(config_cache('pixelfed.cloud_storage') == true) {
(new self())->cloudStore($media);
}

View file

@ -441,7 +441,7 @@ class Helpers {
$media->version = 3;
$media->save();
if(config('pixelfed.cloud_storage') == true) {
if(config_cache('pixelfed.cloud_storage') == true) {
MediaStoragePipeline::dispatch($media);
}
}
@ -511,7 +511,7 @@ class Helpers {
$profile->webfinger = Purify::clean($webfinger);
$profile->last_fetched_at = now();
$profile->save();
if(config('pixelfed.cloud_storage') == true) {
if(config_cache('pixelfed.cloud_storage') == true) {
RemoteAvatarFetch::dispatch($profile);
}
return $profile;
@ -528,7 +528,7 @@ class Helpers {
$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) && Helpers::validateUrl($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
$profile->save();
}
if(config('pixelfed.cloud_storage') == true) {
if(config_cache('pixelfed.cloud_storage') == true) {
RemoteAvatarFetch::dispatch($profile);
}
}