mirror of
https://github.com/krateng/maloja.git
synced 2025-04-19 18:17:36 +03:00
Fixed unneeded album creation
This commit is contained in:
parent
090aee3cf7
commit
c9668c04d2
@ -439,7 +439,12 @@ def get_track_id(trackdict,create_new=True,update_album=False,dbconn=None):
|
||||
if trackdict.get('album') and create_new:
|
||||
# if we don't supply create_new, it means we just want to get info about a track
|
||||
# which means no need to write album info, even if it was new
|
||||
add_track_to_album(row.id,get_album_id(trackdict['album'],dbconn=dbconn),replace=update_album,dbconn=dbconn)
|
||||
# if we havent set update_album, we only want to assign the album in case the track
|
||||
# has no album yet. this means we also only want to create a potentially new album in that case
|
||||
album_id = get_album_id(trackdict['album'],create_new=(update_album or not row.album_id),dbconn=dbconn)
|
||||
add_track_to_album(row.id,album_id,replace=(update_album or not row.album_id),dbconn=dbconn)
|
||||
|
||||
|
||||
return row.id
|
||||
|
||||
if not create_new: return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user