mirror of
https://github.com/werkraum-media/events.git
synced 2024-11-21 22:56:10 +01:00
Do not download already existing files during import (#26)
The usual use cases right now would involve a new file with a new URL. That way we don't need to download existing files again. That reduced network traffic, execution time and resource usage.
This commit is contained in:
parent
d9fef5367a
commit
7b3bbf6d9d
3 changed files with 3 additions and 5 deletions
|
@ -93,11 +93,7 @@ class FilesAssignment
|
||||||
|
|
||||||
if ($importFolder->hasFile($orgFileNameSanitized)) {
|
if ($importFolder->hasFile($orgFileNameSanitized)) {
|
||||||
$this->logger->info('File already exists.', [$orgFileNameSanitized]);
|
$this->logger->info('File already exists.', [$orgFileNameSanitized]);
|
||||||
} else {
|
} elseif ($filename = $this->loadFile($fileUrl)) {
|
||||||
$this->logger->info('File does not exist.', [$orgFileNameSanitized]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($filename = $this->loadFile($fileUrl)) {
|
|
||||||
$this->logger->info('Adding file to FAL.', [$filename]);
|
$this->logger->info('Adding file to FAL.', [$filename]);
|
||||||
$importFolder->addFile($filename, basename($fileUrl), DuplicationBehavior::REPLACE);
|
$importFolder->addFile($filename, basename($fileUrl), DuplicationBehavior::REPLACE);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -34,6 +34,7 @@ Features
|
||||||
* Handle changes to images for events.
|
* Handle changes to images for events.
|
||||||
The import of destination data one only added new images but kept existing images untouched.
|
The import of destination data one only added new images but kept existing images untouched.
|
||||||
This was now improved. The import now will update, remove and re-sort images as well.
|
This was now improved. The import now will update, remove and re-sort images as well.
|
||||||
|
Existing image files won't be downloaded again, only information and position are updated.
|
||||||
|
|
||||||
Fixes
|
Fixes
|
||||||
-----
|
-----
|
||||||
|
|
|
@ -21,6 +21,7 @@ The import will:
|
||||||
* Flush all dates for updated events and re-create all dates.
|
* Flush all dates for updated events and re-create all dates.
|
||||||
|
|
||||||
* Add and update all images for updated and added events.
|
* Add and update all images for updated and added events.
|
||||||
|
Existing image files won't be downloaded again, only information and position are updated.
|
||||||
|
|
||||||
The import will not:
|
The import will not:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue