Skip to content
Snippets Groups Projects
Commit 6e1be964 authored by Georg Krause's avatar Georg Krause
Browse files

Merge branch '1498-fix-scrobber-empty-mbid' into 'develop'

Fix the scrobbler plugin submitting literal "None" as MusicBrainz ID

Closes #1498

See merge request funkwhale/funkwhale!1326

(cherry picked from commit 8273feb5)

572efc79 Fix the scrobbler plugin submitting literal "None" as MusicBrainz ID
parent ea4be336
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ def get_scrobble_payload(track, date, suffix="[0]"): ...@@ -90,7 +90,7 @@ def get_scrobble_payload(track, date, suffix="[0]"):
"l{}".format(suffix): upload.duration if upload else 0, "l{}".format(suffix): upload.duration if upload else 0,
"b{}".format(suffix): (track.album.title if track.album else "") or "", "b{}".format(suffix): (track.album.title if track.album else "") or "",
"n{}".format(suffix): track.position or "", "n{}".format(suffix): track.position or "",
"m{}".format(suffix): str(track.mbid) or "", "m{}".format(suffix): str(track.mbid or ""),
"o{}".format(suffix): "P", # Source: P = chosen by user "o{}".format(suffix): "P", # Source: P = chosen by user
} }
if date: if date:
...@@ -115,7 +115,7 @@ def get_scrobble2_payload(track, date, suffix="[0]"): ...@@ -115,7 +115,7 @@ def get_scrobble2_payload(track, date, suffix="[0]"):
if track.position: if track.position:
data["trackNumber"] = track.position data["trackNumber"] = track.position
if track.mbid: if track.mbid:
data["mbid"] = str(track.mbid) data["mbid"] = str(track.mbid or "")
if date: if date:
offset = upload.duration / 2 if upload.duration else 0 offset = upload.duration / 2 if upload.duration else 0
data["timestamp"] = int(int(date.timestamp()) - offset) data["timestamp"] = int(int(date.timestamp()) - offset)
......
Fix the scrobbler plugin submitting literal "None" as MusicBrainz ID (#1498)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment