Update config() to config_cache()

pull/2762/head
Daniel Supernault 2021-05-18 22:45:04 -06:00
rodzic e8f15b6fa1
commit 41792eea56
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
5 zmienionych plików z 11 dodań i 11 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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