mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed destructive updating with missing fields
This commit is contained in:
parent
f5d1fbc576
commit
c52ad81fc2
@ -216,14 +216,14 @@ def scrobble_dict_to_db(info,dbconn=None):
|
|||||||
"origin":info.get('origin'),
|
"origin":info.get('origin'),
|
||||||
"duration":info.get('duration'),
|
"duration":info.get('duration'),
|
||||||
"track_id":get_track_id(info.get('track'),dbconn=dbconn),
|
"track_id":get_track_id(info.get('track'),dbconn=dbconn),
|
||||||
"extra":json.dumps(info.get('extra')),
|
"extra":json.dumps(info.get('extra')) if info.get('extra') else None,
|
||||||
"rawscrobble":json.dumps(info.get('rawscrobble'))
|
"rawscrobble":json.dumps(info.get('rawscrobble')) if info.get('rawscrobble') else None
|
||||||
}
|
}
|
||||||
|
|
||||||
def track_dict_to_db(info,dbconn=None):
|
def track_dict_to_db(info,dbconn=None):
|
||||||
return {
|
return {
|
||||||
"title":info.get('title'),
|
"title":info.get('title'),
|
||||||
"title_normalized":normalize_name(info.get('title'),'') or None,
|
"title_normalized":normalize_name(info.get('title','')) or None,
|
||||||
"length":info.get('length')
|
"length":info.get('length')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user