mirror of https://github.com/pixelfed/pixelfed.git
Update AvatarOptimize job
This commit is contained in:
parent
a896a6a956
commit
63f920a143
|
@ -10,6 +10,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use Image as Intervention;
|
use Image as Intervention;
|
||||||
|
|
||||||
class AvatarOptimize implements ShouldQueue
|
class AvatarOptimize implements ShouldQueue
|
||||||
|
@ -67,7 +68,7 @@ class AvatarOptimize implements ShouldQueue
|
||||||
|
|
||||||
protected function deleteOldAvatar($new, $current)
|
protected function deleteOldAvatar($new, $current)
|
||||||
{
|
{
|
||||||
if (storage_path('app/'.$new) == $current || $current == 'public/avatars/default.png') {
|
if (storage_path('app/'.$new) == $current || Str::endsWith($current, 'avatars/default.png')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (is_file($current)) {
|
if (is_file($current)) {
|
||||||
|
|
Loading…
Reference in New Issue