mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
move to medium tests
This commit is contained in:
@@ -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[] }];
|
||||
|
||||
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user