Skip to content

Commit

Permalink
Handle FileHashed and FileDetected events (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan authored May 31, 2024
1 parent b43af4a commit c8abbef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/signalr/eventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const invalidateSeries = debounce(
export const handleEvent = (event: string, data?: SeriesUpdateEventType) => {
switch (event) {
case 'FileDeleted':
case 'FileDetected':
case 'FileHashed':
case 'FileMatched':
invalidateDashboard();
invalidateFiles();
Expand Down
2 changes: 2 additions & 0 deletions src/core/signalr/signalr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ async (action: UnknownAction) => {
connectionEvents.on('AVDump:Event', onAvDumpEvent(dispatch));

connectionEvents.on('ShokoEvent:FileDeleted', () => handleEvent('FileDeleted'));
connectionEvents.on('ShokoEvent:FileDetected', () => handleEvent('FileDetected'));
connectionEvents.on('ShokoEvent:FileHashed', () => handleEvent('FileHashed'));
connectionEvents.on('ShokoEvent:FileMatched', () => handleEvent('FileMatched'));
connectionEvents.on('ShokoEvent:FileMoved', () => handleEvent('FileMoved'));
connectionEvents.on('ShokoEvent:FileRenamed', () => handleEvent('FileRenamed'));
Expand Down

0 comments on commit c8abbef

Please sign in to comment.