mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-21 22:18:12 +02:00
feat: simplify mobile dashboard & implement reel queue system
This commit is contained in:
1 parent
dbddf3a74e
commit
08f82d4080
6 files changed
+231
-60
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user