Fix LibraryEventType switch cases for TypeScript build.
Use FILE_ADDED/FILE_UPDATED/FILE_REMOVED to match shared-types. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
7519c9228f
commit
93dbf44fb8
1 changed files with 3 additions and 3 deletions
|
|
@ -10,11 +10,11 @@ export class LibrarySyncService {
|
||||||
async processEvents(nodeId: string, events: LibraryEvent[]): Promise<void> {
|
async processEvents(nodeId: string, events: LibraryEvent[]): Promise<void> {
|
||||||
for (const event of events) {
|
for (const event of events) {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case "ADDED":
|
case "FILE_ADDED":
|
||||||
case "UPDATED":
|
case "FILE_UPDATED":
|
||||||
await this.metadata.matchMediaFile(nodeId, event.file);
|
await this.metadata.matchMediaFile(nodeId, event.file);
|
||||||
break;
|
break;
|
||||||
case "REMOVED":
|
case "FILE_REMOVED":
|
||||||
await prisma.mediaFile.updateMany({
|
await prisma.mediaFile.updateMany({
|
||||||
where: { nodeId, localFileId: event.file.localFileId },
|
where: { nodeId, localFileId: event.file.localFileId },
|
||||||
data: { available: false },
|
data: { available: false },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue