feat: simplify mobile dashboard & implement reel queue system

This commit is contained in:
Michael committed 2026-02-13 10:32:58 +01:00
1 parent dbddf3a74e
commit 08f82d4080
6 files changed
+231 -60

No files matched your search

+20
View File
@@ -71,6 +71,8 @@ export interface IStorage {
updatePostGenerationStatus(id: string, status: string, progress: number, error?: string): Promise<Post>;
deletePost(id: string): Promise<void>;
updatePostMedia(postId: string, mediaIds: string[]): Promise<void>;
countProcessingReels(): Promise<number>;
getNextPendingReel(): Promise<Post | undefined>;
// Scheduled Posts
getScheduledPosts(userId: string, startDate?: Date, endDate?: Date): Promise<ScheduledPost[]>;
@@ -293,6 +295,24 @@ export class DatabaseStorage implements IStorage {
}
}
async countProcessingReels(): Promise<number> {
const processing = await db
.select()
.from(posts)
.where(eq(posts.generationStatus, "processing"));
return processing.length;
}
async getNextPendingReel(): Promise<Post | undefined> {
const [post] = await db
.select()
.from(posts)
.where(eq(posts.generationStatus, "pending"))
.orderBy(asc(posts.createdAt))
.limit(1);
return post || undefined;
}
// Scheduled Posts
async getScheduledPosts(userId: string, startDate?: Date, endDate?: Date): Promise<any[]> {
let query = db