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:
Daniel Siepmann 2023-06-19 10:13:17 +02:00 committed by GitHub
parent d9fef5367a
commit 7b3bbf6d9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View file

@ -93,11 +93,7 @@ class FilesAssignment
if ($importFolder->hasFile($orgFileNameSanitized)) {
$this->logger->info('File already exists.', [$orgFileNameSanitized]);
} else {
$this->logger->info('File does not exist.', [$orgFileNameSanitized]);
}
if ($filename = $this->loadFile($fileUrl)) {
} elseif ($filename = $this->loadFile($fileUrl)) {
$this->logger->info('Adding file to FAL.', [$filename]);
$importFolder->addFile($filename, basename($fileUrl), DuplicationBehavior::REPLACE);
} else {

View file

@ -34,6 +34,7 @@ Features
* Handle changes to images for events.
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.
Existing image files won't be downloaded again, only information and position are updated.
Fixes
-----

View file

@ -21,6 +21,7 @@ The import will:
* Flush all dates for updated events and re-create all dates.
* 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: