diff --git a/maloja/apis/native_v1.py b/maloja/apis/native_v1.py index 093d188..4554d49 100644 --- a/maloja/apis/native_v1.py +++ b/maloja/apis/native_v1.py @@ -458,7 +458,8 @@ def post_scrobble( 'track': { 'artists':result['track']['artists'], 'title':result['track']['title'] - } + }, + 'desc':f"Scrobbled {result['track']['title']} by {','.join(result['track']['artists'])}" } if extra_kwargs: responsedict['warnings'] = [ @@ -684,6 +685,12 @@ def merge_artists(target_id,source_ids): def reparse_scrobble(timestamp): """Internal Use Only""" result = database.reparse_scrobble(timestamp) - return { - "status":"success" - } + if result: + return { + "status":"success" + } + else: + return { + "status":"no-operation", + "desc":"No action was taken." + } diff --git a/maloja/database/__init__.py b/maloja/database/__init__.py index 2663370..666e47f 100644 --- a/maloja/database/__init__.py +++ b/maloja/database/__init__.py @@ -119,7 +119,7 @@ def reparse_scrobble(timestamp): scrobble = sqldb.get_scrobble(timestamp=timestamp, include_internal=True) if not scrobble or not scrobble['rawscrobble']: - return + return False newscrobble = rawscrobble_to_scrobbledict(scrobble['rawscrobble']) @@ -128,6 +128,9 @@ def reparse_scrobble(timestamp): # check if id changed if sqldb.get_track_id(scrobble['track']) != track_id: sqldb.edit_scrobble(timestamp, {'track':newscrobble['track']}) + return True + + return False def rawscrobble_to_scrobbledict(rawscrobble, fix=True, client=None): diff --git a/maloja/web/static/js/notifications.js b/maloja/web/static/js/notifications.js index 43e656f..1cdf323 100644 --- a/maloja/web/static/js/notifications.js +++ b/maloja/web/static/js/notifications.js @@ -41,7 +41,7 @@ function notifyCallback(request) { if (status == 200) { var notification_type = 'info'; var title = "Success!"; - var msg = "Scrobbled " + body.track.title + " by " + body.track.artists.join(", "); + var msg = body.desc || body; } else { var notification_type = 'warning';