IDer
This commit is contained in:
@@ -31,6 +31,7 @@ class SongData(BaseModel):
|
||||
duration_sec: int = 0
|
||||
file_format: str = ""
|
||||
mbid: str = ""
|
||||
acoustid: str = ""
|
||||
|
||||
class DanceData(BaseModel):
|
||||
name: str
|
||||
@@ -115,6 +116,8 @@ def push(
|
||||
existing.bpm = s.bpm
|
||||
if s.mbid and not existing.mbid:
|
||||
existing.mbid = s.mbid
|
||||
if s.acoustid and not existing.acoustid:
|
||||
existing.acoustid = s.acoustid
|
||||
else:
|
||||
song = Song(
|
||||
owner_id=me.id,
|
||||
@@ -122,6 +125,7 @@ def push(
|
||||
bpm=s.bpm, duration_sec=s.duration_sec,
|
||||
file_format=s.file_format,
|
||||
mbid=s.mbid or None,
|
||||
acoustid=s.acoustid or None,
|
||||
)
|
||||
db.add(song)
|
||||
db.flush()
|
||||
|
||||
Reference in New Issue
Block a user