mirror of
https://github.com/AzuraCast/AzuraCast.git
synced 2024-06-14 13:16:37 +00:00
Fixes #6037 -- Fix upload of Custom Browser Icon
This commit is contained in:
parent
b73b5e10bf
commit
9b0a0b159f
|
@ -83,6 +83,6 @@ abstract class AbstractCustomAsset implements CustomAssetInterface
|
||||||
|
|
||||||
protected function ensureDirectoryExists(string $path): void
|
protected function ensureDirectoryExists(string $path): void
|
||||||
{
|
{
|
||||||
(new Filesystem())->mkdir(dirname($path));
|
(new Filesystem())->mkdir($path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ final class AlbumArtCustomAsset extends AbstractMultiPatternCustomAsset
|
||||||
$pattern = $patterns[$mimeType] ?? $patterns['default'];
|
$pattern = $patterns[$mimeType] ?? $patterns['default'];
|
||||||
|
|
||||||
$destPath = $this->getPathForPattern($pattern);
|
$destPath = $this->getPathForPattern($pattern);
|
||||||
$this->ensureDirectoryExists($destPath);
|
$this->ensureDirectoryExists(dirname($destPath));
|
||||||
|
|
||||||
$newImage->save($destPath, 90);
|
$newImage->save($destPath, 90);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ final class BackgroundCustomAsset extends AbstractMultiPatternCustomAsset
|
||||||
$pattern = $patterns[$mimeType] ?? $patterns['default'];
|
$pattern = $patterns[$mimeType] ?? $patterns['default'];
|
||||||
|
|
||||||
$destPath = $this->getPathForPattern($pattern);
|
$destPath = $this->getPathForPattern($pattern);
|
||||||
$this->ensureDirectoryExists($destPath);
|
$this->ensureDirectoryExists(dirname($destPath));
|
||||||
|
|
||||||
$newImage->save($destPath, 90);
|
$newImage->save($destPath, 90);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,8 @@ final class BrowserIconCustomAsset extends AbstractCustomAsset
|
||||||
|
|
||||||
public function upload(Image $image): void
|
public function upload(Image $image): void
|
||||||
{
|
{
|
||||||
|
$this->delete();
|
||||||
|
|
||||||
$uploadsDir = $this->environment->getUploadsDirectory() . '/browser_icon';
|
$uploadsDir = $this->environment->getUploadsDirectory() . '/browser_icon';
|
||||||
$this->ensureDirectoryExists($uploadsDir);
|
$this->ensureDirectoryExists($uploadsDir);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user