Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Added .noimage as a folder exclude filter file #1085

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Command/MigrateGoogleTakeout.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ protected function migrateUser(IUser $user): void
protected function migrateFolder(Folder $folder): void
{
// Check for .nomedia
if ($folder->nodeExists('.nomedia') || $folder->nodeExists('.nomemories')) {
if ($folder->nodeExists('.nomedia') || $folder->nodeExists('.noimage') || $folder->nodeExists('.nomemories')) {
return;
}

Expand Down
1 change: 1 addition & 0 deletions lib/Db/FsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public function getNoMediaFolders(Folder $root, string $key): array

$comp = new SearchBinaryOperator(ISearchBinaryOperator::OPERATOR_OR, [
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'name', '.nomedia'),
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'name', '.noimage'),
new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'name', '.nomemories'),
]);
$search = $root->search(new SearchQuery($comp, 0, 0, [], Util::getUser()));
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/TimelineQueryCTE.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ protected function CTE_FOLDERS_ALL(bool $hidden): string
// Select 1 if there is a .nomedia file in the folder
$SEL_NOMEDIA = "SELECT 1 FROM *PREFIX*filecache f2
WHERE (f2.parent = f.fileid)
AND (f2.name = '.nomedia' OR f2.name = '.nomemories')";
AND (f2.name = '.nomedia' OR f2.name = '.noimage' OR f2.name = '.nomemories')";

// Check no nomedia file exists in the folder
$CLS_NOMEDIA = "NOT EXISTS ({$SEL_NOMEDIA})";
Expand Down
2 changes: 1 addition & 1 deletion lib/Listeners/PostWriteListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function handle(Event $event): void

/** @psalm-suppress RedundantConditionGivenDocblockType */
while ($parent = $parent->getParent()) {
if ($parent->nodeExists('.nomedia') || $parent->nodeExists('.nomemories')) {
if ($parent->nodeExists('.nomedia') || $parent->nodeExists('.noimage') || $parent->nodeExists('.nomemories')) {
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public function indexFolder(Folder $folder): void
$path = $folder->getPath();
$this->log("Indexing folder {$path}", true);

if ($folder->nodeExists('.nomedia') || $folder->nodeExists('.nomemories')) {
$this->log("Skipping folder {$path} (.nomedia / .nomemories)".PHP_EOL, true);
if ($folder->nodeExists('.nomedia') || $folder->nodeExists('.noimage') || $folder->nodeExists('.nomemories')) {
$this->log("Skipping folder {$path}".PHP_EOL, true);

return;
}
Expand Down