diff --git a/maloja/apis/native_v1.py b/maloja/apis/native_v1.py index 3d7a924..0e972b4 100644 --- a/maloja/apis/native_v1.py +++ b/maloja/apis/native_v1.py @@ -250,13 +250,24 @@ def post_scrobble(artist:Multi=None,auth_result=None,**keys): # for logging purposes, don't pass values that we didn't actually supply rawscrobble = {k:rawscrobble[k] for k in rawscrobble if rawscrobble[k]} - return database.incoming_scrobble( + result = database.incoming_scrobble( rawscrobble, client='browser' if auth_result.get('doreah_native_auth_check') else auth_result.get('client'), api='native/v1', fix=(keys.get("nofix") is None) ) + if result: + return { + 'status': 'success', + 'track': { + 'artists':result['track']['artists'], + 'title':result['track']['title'] + } + } + else: + return {"status":"failure"} + diff --git a/maloja/database/__init__.py b/maloja/database/__init__.py index bd42963..267a4a3 100644 --- a/maloja/database/__init__.py +++ b/maloja/database/__init__.py @@ -90,7 +90,8 @@ def incoming_scrobble(rawscrobble,fix=True,client=None,api=None,dbconn=None): if (not "track_artists" in rawscrobble) or (len(rawscrobble['track_artists']) == 0) or (not "track_title" in rawscrobble): log(f"Invalid Scrobble [Client: {client} | API: {api}]: {rawscrobble} ",color='red') - return {"status":"failure"} + #return {"status":"failure"} + return False log(f"Incoming scrobble [Client: {client} | API: {api}]: {rawscrobble}") @@ -127,8 +128,8 @@ def incoming_scrobble(rawscrobble,fix=True,client=None,api=None,dbconn=None): dbcache.invalidate_caches(scrobbledict['time']) - return {"status":"success","scrobble":scrobbledict} - + #return {"status":"success","scrobble":scrobbledict} + return scrobbledict