0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-11 02:23:09 -05:00

feat(server): default exclusion patterns (#12566)

* Add default exclusion patterns

* simplify

* fix tests
This commit is contained in:
Jonathan Jogenfors 2024-09-11 16:40:52 +02:00 committed by GitHub
parent 9b528519e4
commit 233372303b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View file

@ -83,7 +83,7 @@ describe('/libraries', () => {
refreshedAt: null, refreshedAt: null,
assetCount: 0, assetCount: 0,
importPaths: [], importPaths: [],
exclusionPatterns: [], exclusionPatterns: expect.any(Array),
}), }),
); );
}); });
@ -270,7 +270,7 @@ describe('/libraries', () => {
refreshedAt: null, refreshedAt: null,
assetCount: 0, assetCount: 0,
importPaths: [], importPaths: [],
exclusionPatterns: [], exclusionPatterns: expect.any(Array),
}), }),
); );
}); });

View file

@ -892,7 +892,7 @@ describe(LibraryService.name, () => {
expect.objectContaining({ expect.objectContaining({
name: expect.any(String), name: expect.any(String),
importPaths: [], importPaths: [],
exclusionPatterns: [], exclusionPatterns: expect.any(Array),
}), }),
); );
}); });
@ -917,7 +917,7 @@ describe(LibraryService.name, () => {
expect.objectContaining({ expect.objectContaining({
name: 'My Awesome Library', name: 'My Awesome Library',
importPaths: [], importPaths: [],
exclusionPatterns: [], exclusionPatterns: expect.any(Array),
}), }),
); );
}); });
@ -947,7 +947,7 @@ describe(LibraryService.name, () => {
expect.objectContaining({ expect.objectContaining({
name: expect.any(String), name: expect.any(String),
importPaths: ['/data/images', '/data/videos'], importPaths: ['/data/images', '/data/videos'],
exclusionPatterns: [], exclusionPatterns: expect.any(Array),
}), }),
); );
}); });

View file

@ -245,7 +245,7 @@ export class LibraryService {
ownerId: dto.ownerId, ownerId: dto.ownerId,
name: dto.name ?? 'New External Library', name: dto.name ?? 'New External Library',
importPaths: dto.importPaths ?? [], importPaths: dto.importPaths ?? [],
exclusionPatterns: dto.exclusionPatterns ?? [], exclusionPatterns: dto.exclusionPatterns ?? ['**/@eaDir/**', '**/._*'],
}); });
return mapLibrary(library); return mapLibrary(library);
} }