chore(server): cleanup library watching (#8835)

chore: clean up library watching
This commit is contained in:
Jason Rasmussen 2024-04-15 23:05:08 -04:00 committed by GitHub
parent 1c1e461936
commit dba365634a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 56 additions and 1088 deletions

View file

@ -27,6 +27,7 @@ describe('/library', () => {
beforeAll(async () => {
await utils.resetDatabase();
admin = await utils.adminSetup();
await utils.resetAdminConfig(admin.accessToken);
user = await utils.userSetup(admin.accessToken, userDto.user1);
library = await utils.createLibrary(admin.accessToken, { ownerId: admin.userId, type: LibraryType.External });
websocket = await utils.connectWebsocket(admin.accessToken);
@ -36,7 +37,7 @@ describe('/library', () => {
afterAll(() => {
utils.disconnectWebsocket(websocket);
utils.deleteTempFolder();
utils.resetTempFolder();
});
beforeEach(() => {
@ -816,40 +817,4 @@ describe('/library', () => {
expect(existsSync(`${testAssetDir}/temp/directoryB/assetB.png`)).toBe(true);
});
});
// describe('Watching', () => {
// beforeAll(async () => {
// const config = await getConfigDefaults({ headers: asBearerAuth(admin.accessToken) });
// await updateConfig(
// { systemConfigDto: { ...config, library: { ...config.library, watch: { enabled: true } } } },
// { headers: asBearerAuth(admin.accessToken) },
// );
// });
// afterAll(async () => {
// const defaultConfig = await getConfigDefaults({ headers: asBearerAuth(admin.accessToken) });
// await updateConfig({ systemConfigDto: defaultConfig }, { headers: asBearerAuth(admin.accessToken) });
// rmSync(`${testAssetDir}/temp/watch`, { recursive: true });
// });
// describe('Single import path', () => {
// let library: LibraryResponseDto;
// beforeEach(async () => {
// library = await utils.createLibrary(admin.accessToken, {
// ownerId: admin.userId,
// type: LibraryType.External,
// importPaths: [`${testAssetDirInternal}/temp`],
// });
// });
// it('should import a new file', async () => {
// utils.createImageFile(`${testAssetDir}/temp/watch/assetA.png`);
// await utils.waitForWebsocketEvent({ event: 'assetUpload', total: 1 });
// const { assets } = await utils.metadataSearch(admin.accessToken, { libraryId: library.id });
// expect(assets.count).toEqual(3);
// });
// });
// });
});