move to medium tests

This commit is contained in:
Jonathan Jogenfors
2026-03-24 14:03:32 +01:00
parent 05b07ca233
commit 292fbef180
9 changed files with 309 additions and 231 deletions
@@ -95,10 +95,6 @@ type EventMap = {
// websocket events
WebsocketConnect: [{ userId: string }];
// library events
LibraryWatchEnabled: [{ id: string }];
LibraryWatchFired: [{ libraryId: string; event: 'add' | 'change' | 'unlink'; path: string; ignored: boolean }];
};
export type AppRestartEvent = {
@@ -35,9 +35,6 @@ export interface ClientEventMap {
on_notification: [NotificationDto];
on_session_delete: [string];
on_library_watch_enabled: [{ libraryId: string }];
on_library_watch_fired: [{ libraryId: string; event: 'add' | 'change' | 'unlink'; path: string; ignored: boolean }];
AssetUploadReadyV1: [{ asset: SyncAssetV1; exif: SyncAssetExifV1 }];
AppRestartV1: [AppRestartEvent];
AssetEditReadyV1: [{ asset: SyncAssetV1; edit: SyncAssetEditV1[] }];
-16
View File
@@ -107,13 +107,6 @@ export class LibraryService extends BaseService {
const handler = async (event: string, path: string) => {
const ignored = !isSupportedFile(path);
await this.eventRepository.emit('LibraryWatchFired', {
libraryId: library.id,
event: event as 'add' | 'change',
path,
ignored,
});
if (ignored) {
this.logger.verbose(`Ignoring file ${event} event for ${path} in library ${library.id}`);
return;
@@ -127,13 +120,6 @@ export class LibraryService extends BaseService {
};
const deletionHandler = async (path: string) => {
await this.eventRepository.emit('LibraryWatchFired', {
libraryId: library.id,
event: 'unlink',
path,
ignored: false,
});
this.logger.debug(`File unlink event received for ${path} in library ${library.id}}`);
await this.jobRepository.queue({
name: JobName.LibraryRemoveAsset,
@@ -172,8 +158,6 @@ export class LibraryService extends BaseService {
// Wait for the watcher to initialize before returning
await ready$;
await this.eventRepository.emit('LibraryWatchEnabled', { id });
return true;
}
@@ -114,16 +114,6 @@ export class NotificationService extends BaseService {
this.websocketRepository.serverSend('ConfigUpdate', { oldConfig, newConfig });
}
@OnEvent({ name: 'LibraryWatchEnabled' })
onLibraryWatchEnabled({ id }: ArgOf<'LibraryWatchEnabled'>) {
this.websocketRepository.clientBroadcast('on_library_watch_enabled', { libraryId: id });
}
@OnEvent({ name: 'LibraryWatchFired' })
onLibraryWatchFired(event: ArgOf<'LibraryWatchFired'>) {
this.websocketRepository.clientBroadcast('on_library_watch_fired', event);
}
@OnEvent({ name: 'AppRestart' })
onAppRestart(state: ArgOf<'AppRestart'>) {
this.websocketRepository.clientBroadcast('AppRestartV1', {