Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Sep 23, 2022
1 parent ff22fdb commit ac3a8df
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/BackgroundJobs/StorageCrawlJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ protected function run($argument): void {
if (in_array(MusicnnClassifier::MODEL_NAME, $models)) {
$mimeTypes = array_merge($audioTypes, $mimeTypes);
}
if (count($mimeTypes) === 0) {
// Remove current iteration
$this->jobList->remove(self::class, $argument);
return;
}

try {
$qb = new CacheQueryBuilder($this->db, $this->systemConfig, $this->logger);
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function setSetting(string $setting, $value) {
break;
case ImagenetClassifier::MODEL_NAME . '.enabled':
$this->jobList->add(SchedulerJob::class, ['models' => [ImagenetClassifier::MODEL_NAME]]);
// no break
break;
case LandmarksClassifier::MODEL_NAME . '.enabled':
$this->jobList->add(SchedulerJob::class, ['models' => [LandmarksClassifier::MODEL_NAME]]);
break;
Expand Down
2 changes: 1 addition & 1 deletion test/ClassifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ClassifierTest extends TestCase {
public const TEST_USER1 = 'test-user1';

public const TEST_FILES = ['alpine.jpg' ,'eiffeltower.jpg', 'Rock_Rejam.mp3', 'jumpingjack.gif'];
const ALL_MODELS = [
public const ALL_MODELS = [
ClusteringFaceClassifier::MODEL_NAME,
ImagenetClassifier::MODEL_NAME,
LandmarksClassifier::MODEL_NAME,
Expand Down

0 comments on commit ac3a8df

Please sign in to comment.