Эх сурвалжийг харах

refactor: clean up ProviderVideoSyncOptions interface by removing unnecessary comments and whitespace; simplify VideoMediaService updateVideoTags method by removing secondTags handling

Dave 1 сар өмнө
parent
commit
fbdec24224

+ 0 - 29
apps/box-mgnt-api/src/mgnt-backend/feature/provider-video-sync/provider-video-sync.service.ts

@@ -8,44 +8,15 @@ import { EntityType } from '@prisma/mongo/client';
 
 export interface ProviderVideoSyncOptions {
   providerCode?: string;
-
-  /**
-   * Optional override. In normal usage, we resume from SyncState cursor:
-   * - fullSync: pageNum resumes
-   * - incremental: always pageNum=1
-   */
   pageNum?: number;
-
-  /**
-   * Default 200, hard-capped to 500.
-   */
   pageSize?: number;
-
-  /**
-   * Provider search param.
-   * - status: required in your business rule ("Completed")
-   * - updatedAt: ISO string filter "updated after"
-   */
   param?: {
     status?: string;
     updatedAt?: string;
     [k: string]: any;
   };
-
-  /**
-   * fullSync:
-   * - true: no param.updatedAt; resume using stored pageNum
-   * - false: use param.updatedAt (cursor); pageNum forced to 1
-   */
   fullSync?: boolean;
-
-  /**
-   * If true: ignore stored cursor and start fresh.
-   * - fullSync: pageNum from options.pageNum or 1
-   * - incremental: updatedAtCursor from options.param.updatedAt (if provided)
-   */
   resetState?: boolean;
-
   [key: string]: any;
 }
 

+ 1 - 8
apps/box-mgnt-api/src/mgnt-backend/feature/video-media/video-media.service.ts

@@ -332,8 +332,6 @@ export class VideoMediaService {
       where: { id: dto.id },
       select: {
         id: true,
-        secondTags: true,
-        tags: true,
       },
     });
 
@@ -349,16 +347,11 @@ export class VideoMediaService {
     );
     const mgntTagNames = mgntVTags.map((t) => t.tagName);
 
-    const original = video.tags ?? [];
-    const mergedSecondTags = Array.from(
-      new Set([...original, ...mgntTagNames]),
-    );
-
     await this.prisma.videoMedia.update({
       where: { id: dto.id },
       data: {
         vTags: { set: mgntVTags },
-        tags: { set: mergedSecondTags },
+        tags: { set: mgntTagNames },
         editedAt: BigInt(Math.floor(Date.now() / 1000)),
         updatedAt: new Date(),
       },