mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-18 04:36:32 +02:00
feat: Implement internal MP3 management and logo overlay functionality for Reels.
This commit is contained in:
1 parent
d89de20df2
commit
0e9622b5eb
12 files changed
+632
-8
No files matched your search
@@ -34,6 +34,9 @@ import {
|
||||
freesoundConfig,
|
||||
type FreesoundConfig,
|
||||
type InsertFreesoundConfig,
|
||||
audioTracks,
|
||||
type AudioTrack,
|
||||
type InsertAudioTrack,
|
||||
} from "@shared/schema";
|
||||
import { db } from "./db";
|
||||
import { eq, and, gte, lte, desc, asc, isNull, inArray } from "drizzle-orm";
|
||||
@@ -114,6 +117,12 @@ export interface IStorage {
|
||||
removeMusicFavorite(userId: string, trackId: string): Promise<void>;
|
||||
isMusicFavorite(userId: string, trackId: string): Promise<boolean>;
|
||||
|
||||
// Audio Tracks
|
||||
getAudioTracks(): Promise<AudioTrack[]>;
|
||||
getAudioTrack(id: string): Promise<AudioTrack | undefined>;
|
||||
createAudioTrack(track: InsertAudioTrack): Promise<AudioTrack>;
|
||||
deleteAudioTrack(id: string): Promise<void>;
|
||||
|
||||
// Freesound Config
|
||||
getFreesoundConfig(userId: string): Promise<FreesoundConfig | undefined>;
|
||||
createFreesoundConfig(config: InsertFreesoundConfig): Promise<FreesoundConfig>;
|
||||
@@ -541,6 +550,25 @@ export class DatabaseStorage implements IStorage {
|
||||
return !!fav;
|
||||
}
|
||||
|
||||
// Audio Tracks
|
||||
async getAudioTracks(): Promise<AudioTrack[]> {
|
||||
return db.select().from(audioTracks).orderBy(desc(audioTracks.createdAt));
|
||||
}
|
||||
|
||||
async getAudioTrack(id: string): Promise<AudioTrack | undefined> {
|
||||
const [track] = await db.select().from(audioTracks).where(eq(audioTracks.id, id));
|
||||
return track || undefined;
|
||||
}
|
||||
|
||||
async createAudioTrack(track: InsertAudioTrack): Promise<AudioTrack> {
|
||||
const [newTrack] = await db.insert(audioTracks).values(track).returning();
|
||||
return newTrack;
|
||||
}
|
||||
|
||||
async deleteAudioTrack(id: string): Promise<void> {
|
||||
await db.delete(audioTracks).where(eq(audioTracks.id, id));
|
||||
}
|
||||
|
||||
// Freesound Config
|
||||
async getFreesoundConfig(userId: string): Promise<FreesoundConfig | undefined> {
|
||||
const [config] = await db.select().from(freesoundConfig).where(eq(freesoundConfig.userId, userId));
|
||||
|
||||
Reference in new issue
Block a user