jbilcke-hf HF staff commited on
Commit
0465776
1 Parent(s): 99791c5
src/app/store.ts CHANGED
@@ -1,6 +1,6 @@
1
  "use client"
2
 
3
- import { ClapProject, parseClap, serializeClap, ClapMediaOrientation, parseMediaOrientation, ClapSegmentCategory, newSegment, getClapAssetSourceType } from "@aitube/clap"
4
  import { create } from "zustand"
5
 
6
  import { GenerationStage, GlobalStatus, TaskStatus } from "@/types"
@@ -294,7 +294,7 @@ export const useStore = create<{
294
 
295
  const alreadyAnEmbeddedFinalVideo = fullClap.segments.filter(s =>
296
  s.category === ClapSegmentCategory.VIDEO &&
297
- s.status === "completed" &&
298
  s.startTimeInMs === 0 &&
299
  s.endTimeInMs === fullClap.meta.durationInMs &&
300
  s.assetUrl).at(0)
@@ -307,7 +307,7 @@ export const useStore = create<{
307
  console.log(`editing the clap to add a new final video`)
308
  fullClap.segments.push(newSegment({
309
  category: ClapSegmentCategory.VIDEO,
310
- status: "completed",
311
  startTimeInMs: 0,
312
  endTimeInMs: fullClap.meta.durationInMs,
313
  assetUrl: currentVideo,
@@ -366,7 +366,7 @@ export const useStore = create<{
366
 
367
  const embeddedFinalVideoAssetUrl = fullClap.segments.filter(s =>
368
  s.category === ClapSegmentCategory.VIDEO &&
369
- s.status === "completed" &&
370
  s.startTimeInMs === 0 &&
371
  s.endTimeInMs === fullClap.meta.durationInMs &&
372
  s.assetUrl).map(s => s.assetUrl).at(0)
 
1
  "use client"
2
 
3
+ import { ClapProject, parseClap, serializeClap, ClapMediaOrientation, parseMediaOrientation, ClapSegmentCategory, newSegment, getClapAssetSourceType, ClapSegmentStatus } from "@aitube/clap"
4
  import { create } from "zustand"
5
 
6
  import { GenerationStage, GlobalStatus, TaskStatus } from "@/types"
 
294
 
295
  const alreadyAnEmbeddedFinalVideo = fullClap.segments.filter(s =>
296
  s.category === ClapSegmentCategory.VIDEO &&
297
+ s.status === ClapSegmentStatus.COMPLETED &&
298
  s.startTimeInMs === 0 &&
299
  s.endTimeInMs === fullClap.meta.durationInMs &&
300
  s.assetUrl).at(0)
 
307
  console.log(`editing the clap to add a new final video`)
308
  fullClap.segments.push(newSegment({
309
  category: ClapSegmentCategory.VIDEO,
310
+ status: ClapSegmentStatus.COMPLETED,
311
  startTimeInMs: 0,
312
  endTimeInMs: fullClap.meta.durationInMs,
313
  assetUrl: currentVideo,
 
366
 
367
  const embeddedFinalVideoAssetUrl = fullClap.segments.filter(s =>
368
  s.category === ClapSegmentCategory.VIDEO &&
369
+ s.status === ClapSegmentStatus.COMPLETED &&
370
  s.startTimeInMs === 0 &&
371
  s.endTimeInMs === fullClap.meta.durationInMs &&
372
  s.assetUrl).map(s => s.assetUrl).at(0)
src/lib/hooks/useProcessors.ts CHANGED
@@ -1,7 +1,7 @@
1
  "use client"
2
 
3
  import React, { useState, useTransition } from "react"
4
- import { ClapProject, ClapSegmentCategory, filterAssets, getClapAssetSourceType, newEntity, parseClap, serializeClap, updateClap } from "@aitube/clap"
5
 
6
  import { logImage } from "@/lib/utils"
7
  import { useIsBusy, useStoryPromptDraft } from "@/lib/hooks"
@@ -271,7 +271,7 @@ export function useProcessors() {
271
  clap.segments
272
  .filter(s => s.category === ClapSegmentCategory.STORYBOARD)
273
  .forEach((s, i) => {
274
- if (s.status === "completed" && s.assetUrl) {
275
  // console.log(` [${i}] storyboard: ${s.prompt}`)
276
  logImage(s.assetUrl, 0.35)
277
  } else {
 
1
  "use client"
2
 
3
  import React, { useState, useTransition } from "react"
4
+ import { ClapProject, ClapSegmentCategory, ClapSegmentStatus, filterAssets, getClapAssetSourceType, newEntity, parseClap, serializeClap, updateClap } from "@aitube/clap"
5
 
6
  import { logImage } from "@/lib/utils"
7
  import { useIsBusy, useStoryPromptDraft } from "@/lib/hooks"
 
271
  clap.segments
272
  .filter(s => s.category === ClapSegmentCategory.STORYBOARD)
273
  .forEach((s, i) => {
274
+ if (s.status === ClapSegmentStatus.COMPLETED && s.assetUrl) {
275
  // console.log(` [${i}] storyboard: ${s.prompt}`)
276
  logImage(s.assetUrl, 0.35)
277
  } else {
src/lib/utils/removeFinalVideos.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { ClapProject, ClapSegment, ClapSegmentCategory } from "@aitube/clap"
2
 
3
  export function removeFinalVideos(clap: ClapProject): ClapSegment[] {
4
  const alreadyAnEmbeddedFinalVideo = clap.segments.filter(s =>
5
  s.category === ClapSegmentCategory.VIDEO &&
6
- s.status === "completed" &&
7
  s.startTimeInMs === 0 &&
8
  s.endTimeInMs === clap.meta.durationInMs &&
9
  s.assetUrl).at(0)
 
1
+ import { ClapProject, ClapSegment, ClapSegmentCategory, ClapSegmentStatus } from "@aitube/clap"
2
 
3
  export function removeFinalVideos(clap: ClapProject): ClapSegment[] {
4
  const alreadyAnEmbeddedFinalVideo = clap.segments.filter(s =>
5
  s.category === ClapSegmentCategory.VIDEO &&
6
+ s.status === ClapSegmentStatus.COMPLETED &&
7
  s.startTimeInMs === 0 &&
8
  s.endTimeInMs === clap.meta.durationInMs &&
9
  s.assetUrl).at(0)