Skip to content

Commit dfcc429

Browse files
committed
WIP
1 parent ca23652 commit dfcc429

File tree

4 files changed

+32
-187
lines changed

4 files changed

+32
-187
lines changed

app/Http/Controllers/Gallery/PhotoController.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use App\Image\Files\NativeLocalFile;
2727
use App\Image\Files\ProcessableJobFile;
2828
use App\Image\Files\UploadedFile;
29+
use App\Jobs\ExtractZip;
2930
use App\Jobs\ProcessImageJob;
3031
use App\Models\Configs;
3132
use App\Models\Photo;
@@ -81,6 +82,14 @@ private function process(
8182
$processableFile->close();
8283
// End of work-around
8384

85+
if (Configs::getValueAsBool('extract_zip_on_upload') &&
86+
\Str::endsWith($processableFile->getPath(), '.zip')) {
87+
ExtractZip::dispatch($processableFile, $album->id, $file_last_modified_time);
88+
$meta->stage = FileStatus::DONE->value;
89+
90+
return $meta;
91+
}
92+
8493
if (Configs::getValueAsBool('use_job_queues')) {
8594
ProcessImageJob::dispatch($processableFile, $album, $file_last_modified_time);
8695
$meta->stage = FileStatus::READY;

app/Livewire/Components/Forms/Add/Upload.php

Lines changed: 0 additions & 185 deletions
This file was deleted.

database/migrations/2024_10_14_104644_show_nsfw_in_smart_albums.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
use App\Models\Extensions\BaseConfigMigration;
44

55
return new class() extends BaseConfigMigration {
6-
public const OAUTH = 'OAuth & SSO';
7-
86
public function getConfigs(): array
97
{
108
return [
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
use App\Models\Extensions\BaseConfigMigration;
4+
5+
return new class() extends BaseConfigMigration {
6+
public const PROCESSING = 'Image Processing';
7+
8+
public function getConfigs(): array
9+
{
10+
return [
11+
[
12+
'key' => 'extract_zip_on_upload',
13+
'value' => '0',
14+
'cat' => self::PROCESSING,
15+
'type_range' => self::BOOL,
16+
'description' => 'Extract uploaded zip file and import content.',
17+
'details' => 'Zip file will stay on your server unless it is properly extracted without faults (after which it is removed).',
18+
'is_secret' => false,
19+
'level' => 1, // Only for SE.
20+
],
21+
];
22+
}
23+
};

0 commit comments

Comments
 (0)