upload db on timestamped lyric
parent
da59f3d6e3
commit
94be8a0746
|
|
@ -25,6 +25,8 @@ from app.dependencies.pagination import (
|
||||||
from app.home.models import Project
|
from app.home.models import Project
|
||||||
from app.lyric.models import Lyric
|
from app.lyric.models import Lyric
|
||||||
from app.song.models import Song
|
from app.song.models import Song
|
||||||
|
from app.song.models import SongTimestamp
|
||||||
|
|
||||||
from app.song.schemas.song_schema import (
|
from app.song.schemas.song_schema import (
|
||||||
DownloadSongResponse,
|
DownloadSongResponse,
|
||||||
GenerateSongRequest,
|
GenerateSongRequest,
|
||||||
|
|
@ -390,6 +392,17 @@ async def get_song_status(
|
||||||
|
|
||||||
timestamped_lyrics = await suno_service.align_lyrics(word_data, sentences)
|
timestamped_lyrics = await suno_service.align_lyrics(word_data, sentences)
|
||||||
# TODO : DB upload timestamped_lyrics
|
# TODO : DB upload timestamped_lyrics
|
||||||
|
for order_idx, timestamped_lyric in enumerate(timestamped_lyrics):
|
||||||
|
song_timestamp = SongTimestamp(
|
||||||
|
suno_audio_id = suno_audio_id,
|
||||||
|
order_idx = order_idx,
|
||||||
|
lyric_line = timestamped_lyric["text"],
|
||||||
|
start_time = timestamped_lyric["start_sec"],
|
||||||
|
end_time = timestamped_lyric["end_sec"]
|
||||||
|
)
|
||||||
|
session.add(song_timestamp)
|
||||||
|
|
||||||
|
await session.commit()
|
||||||
|
|
||||||
if song and song.status != "completed":
|
if song and song.status != "completed":
|
||||||
# 첫 번째 클립의 audio_url과 duration을 직접 DB에 저장
|
# 첫 번째 클립의 audio_url과 duration을 직접 DB에 저장
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue