normalize filenames

This commit is contained in:
HolgerHatGarKeineNode
2023-02-27 16:50:25 +01:00
parent 9896618944
commit 2be0b8da2a
13 changed files with 145 additions and 126 deletions

View File

@@ -72,7 +72,7 @@ class LibraryItemForm extends Component
$this->libraryItem = new LibraryItem([
'approved' => true,
'read_time' => 1,
'value' => '',
'value' => '',
]);
if ($this->lecturer) {
$this->library = Library::query()
@@ -106,11 +106,13 @@ class LibraryItemForm extends Component
if ($this->image) {
$this->libraryItem->addMedia($this->image)
->usingFileName(md5($this->image->getClientOriginalName()).'.'.$this->image->getClientOriginalExtension())
->toMediaCollection('main');
}
if ($this->file) {
$this->libraryItem->addMedia($this->file)
->usingFileName(md5($this->file->getClientOriginalName()).'.'.$this->file->getClientOriginalExtension())
->toMediaCollection('single_file');
}