Skip to content

Commit

Permalink
Skip only non-face cluster for tagged files
Browse files Browse the repository at this point in the history
  • Loading branch information
nielstron committed Sep 11, 2024
1 parent 81ed2a7 commit 465e7bf
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/Command/Classify.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,30 @@ protected function execute(InputInterface $input, OutputInterface $output): int
];
foreach ($this->storageService->getFilesInMount($mount['storage_id'], $mount['override_root'], $models, $lastFileId) as $file) {
$i++;
// if retry flag is set, skip tagged files
$lastFileId = $file['fileid'];
$queueFile = new QueueFile();
$queueFile->setStorageId($mount['storage_id']);
$queueFile->setRootId($mount['root_id']);
$queueFile->setFileId($file['fileid']);
$queueFile->setUpdate(false);

if ($file['image']) {
if (in_array(ClusteringFaceClassifier::MODEL_NAME, $models)) {
$queues[ClusteringFaceClassifier::MODEL_NAME][] = $queueFile;
}
}
// if retry flag is set, skip other classifiers for tagged files
if ($input->getOption('retry')) {
$fileTags = $this->tagManager->getTagsForFiles([$lastFileId]);
// check if processed tag is already in the tags
if (in_array($processedTag, $fileTags[$lastFileId])) {

Check failure on line 129 in lib/Command/Classify.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.1, dev-master)

MixedArgument

lib/Command/Classify.php:129:35: MixedArgument: Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 129 in lib/Command/Classify.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.2, dev-master)

MixedArgument

lib/Command/Classify.php:129:35: MixedArgument: Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)

Check failure on line 129 in lib/Command/Classify.php

View workflow job for this annotation

GitHub Actions / Nextcloud (8.3, dev-master)

MixedArgument

lib/Command/Classify.php:129:35: MixedArgument: Argument 2 of in_array cannot be mixed, expecting array<array-key, mixed> (see https://psalm.dev/030)
continue;
}
}
$queueFile = new QueueFile();
$queueFile->setStorageId($mount['storage_id']);
$queueFile->setRootId($mount['root_id']);
$queueFile->setFileId($file['fileid']);
$queueFile->setUpdate(false);

if ($file['image']) {
if (in_array(ImagenetClassifier::MODEL_NAME, $models)) {
$queues[ImagenetClassifier::MODEL_NAME][] = $queueFile;
}
if (in_array(ClusteringFaceClassifier::MODEL_NAME, $models)) {
$queues[ClusteringFaceClassifier::MODEL_NAME][] = $queueFile;
}
}
if ($file['video']) {
if (in_array(MovinetClassifier::MODEL_NAME, $models)) {
Expand Down

0 comments on commit 465e7bf

Please sign in to comment.