videosphere
    Preparing search index...

    Function cleanupDistributedDraftThumbnails

    • Clears distributed draft thumbnail keys from the draft document and deletes the R2 objects. Uses the metadata snapshot from this distribution attempt so thumbnails replaced mid-upload are not removed. Clears shared thumbnailR2Key with null and per-platform overrides with '' so platforms do not fall back to a shared thumbnail that was not distributed.

      Parameters

      • jobId: string

        Upload job id (for logging).

      • userId: string

        Draft owner.

      • draftId: string

        Draft whose thumbnails were distributed.

      • platformUploads: PlatformUpload[]

        Platform upload rows included in this distribution attempt.

      • metadataByPlatformId: Map<string, PlatformUploadMetadata>

        Metadata snapshot keyed by platform upload id.

      Returns Promise<void>