feat(reels): add real-time generation progress tracking on dashboard (desktop & mobile)

This commit is contained in:
Michael committed 2026-02-12 10:33:00 +01:00
1 parent 11b5ef0ad2
commit e1c6b51e0a
7 files changed
+209 -6

No files matched your search

+23
View File
@@ -68,6 +68,7 @@ export interface IStorage {
getPostWithMedia(id: string): Promise<{ post: Post; media: Media[] } | undefined>;
createPost(post: InsertPost): Promise<Post>;
updatePost(id: string, post: Partial<InsertPost>): Promise<Post>;
updatePostGenerationStatus(id: string, status: string, progress: number, error?: string): Promise<Post>;
deletePost(id: string): Promise<void>;
updatePostMedia(postId: string, mediaIds: string[]): Promise<void>;
@@ -257,6 +258,28 @@ export class DatabaseStorage implements IStorage {
await db.delete(posts).where(eq(posts.id, id));
}
async updatePostGenerationStatus(
id: string,
status: string,
progress: number,
error?: string
): Promise<Post> {
const updateData: Record<string, unknown> = {
generationStatus: status,
generationProgress: progress,
updatedAt: new Date(),
};
if (error !== undefined) {
updateData.generationError = error;
}
const [updated] = await db
.update(posts)
.set(updateData)
.where(eq(posts.id, id))
.returning();
return updated;
}
async updatePostMedia(postId: string, mediaIds: string[]): Promise<void> {
await db.delete(postMedia).where(eq(postMedia.postId, postId));