Skip to content

Commit

Permalink
feat(server): default exclusion patterns (immich-app#12566)
Browse files Browse the repository at this point in the history
* Add default exclusion patterns

* simplify

* fix tests
  • Loading branch information
etnoy authored Sep 11, 2024
1 parent 9b52851 commit 2333723
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions e2e/src/api/specs/library.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('/libraries', () => {
refreshedAt: null,
assetCount: 0,
importPaths: [],
exclusionPatterns: [],
exclusionPatterns: expect.any(Array),
}),
);
});
Expand Down Expand Up @@ -270,7 +270,7 @@ describe('/libraries', () => {
refreshedAt: null,
assetCount: 0,
importPaths: [],
exclusionPatterns: [],
exclusionPatterns: expect.any(Array),
}),
);
});
Expand Down
6 changes: 3 additions & 3 deletions server/src/services/library.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ describe(LibraryService.name, () => {
expect.objectContaining({
name: expect.any(String),
importPaths: [],
exclusionPatterns: [],
exclusionPatterns: expect.any(Array),
}),
);
});
Expand All @@ -917,7 +917,7 @@ describe(LibraryService.name, () => {
expect.objectContaining({
name: 'My Awesome Library',
importPaths: [],
exclusionPatterns: [],
exclusionPatterns: expect.any(Array),
}),
);
});
Expand Down Expand Up @@ -947,7 +947,7 @@ describe(LibraryService.name, () => {
expect.objectContaining({
name: expect.any(String),
importPaths: ['/data/images', '/data/videos'],
exclusionPatterns: [],
exclusionPatterns: expect.any(Array),
}),
);
});
Expand Down
2 changes: 1 addition & 1 deletion server/src/services/library.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class LibraryService {
ownerId: dto.ownerId,
name: dto.name ?? 'New External Library',
importPaths: dto.importPaths ?? [],
exclusionPatterns: dto.exclusionPatterns ?? [],
exclusionPatterns: dto.exclusionPatterns ?? ['**/@eaDir/**', '**/._*'],
});
return mapLibrary(library);
}
Expand Down

0 comments on commit 2333723

Please sign in to comment.