Listened_at parameter for submissions, specification unclear

The spec indicates the following:

The payload should also include the listened_at element, which must be an integer representing the Unix time when the track was listened to.

However, it’s unclear what “the track was listened to” means. Does it mean when playback of the track started? When it finished?

The last.fm spec is explicit in that the timestamp should be from when the track started playback.

I ask this here but what I really want is to request the spec to be clarified, so if there’s a better place to do that, I would appreciate pointers.

3 Likes

When I wrote my submission client for MPD I also assumed it would mean when the track started playing.

I agree that the documentation is unclear about this and should be clarified.

Start of listen makes the most sense to me. The majority of players that supported last.fm submission used that date. And LB implementation for such players usually closely follow the last.fm behavior.

I also used the playback start date for my own submission client.

3 Likes

Any suggestion as to where to submit the change request for the specification?

You might just try a PR on the docs: https://github.com/metabrainz/listenbrainz-server/blob/master/docs/users/json.rst

1 Like

@lucifer @rob Is there some official opinion on this? I just came across this when looking over the foobar2000 component, which uses the time of submission as listened_at (so either after half the track or 4 minutes into the playback). I just looked over some of the implementations I had been involved with. My own Android submission app and the rhythmbox plugin use start of playback, as does the lollypop player if I interpret the code correctly.

UPDATE: Funkwhale also seems to use timestamp at submission time.

1 Like

I’ve not had a chance to look at this, but is been in my inbox for weeks it seems. @lucifer would likely be a better candidate to answer this than me. Let me ping him.

1 Like

@csaavedra @outsidecontext AFAIR we use the start of playback time in most plugins and importers for listened_at so it would make sense to continue with that.

2 Likes

I opened Docs: Clarify that listened_at should be set to start of playback by phw · Pull Request #2607 · metabrainz/listenbrainz-server · GitHub to update the docs to clarify this.

1 Like

The changes have been merged. I think with this the question is answered.

Ideally clients should use the start time of listening. But it might not always be possible to do so due to technical limitations.

1 Like