Commit
•
0465776
1
Parent(s):
99791c5
fix
Browse files- src/app/store.ts +4 -4
- src/lib/hooks/useProcessors.ts +2 -2
- src/lib/utils/removeFinalVideos.ts +2 -2
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 ===
|
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:
|
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 ===
|
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 ===
|
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 ===
|
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)
|