# Listened\_at parameter for submissions, specification unclear

**URL:** https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142
**Category:** ListenBrainz
**Tags:** documentation, development, listenbrainz
**Created:** [October 9, 2023, 3:28pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142 "2023-10-09T15:28:23Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![csaavedra](https://community.metabrainz.org/user_avatar/community.metabrainz.org/csaavedra/32/65091_2.png) [@csaavedra](https://community.metabrainz.org/u/csaavedra)
#### Post date: [October 9, 2023, 3:28pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/1 "2023-10-09T15:28:23Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![elomatreb](https://community.metabrainz.org/user_avatar/community.metabrainz.org/elomatreb/32/44009_2.png) [@elomatreb](https://community.metabrainz.org/u/elomatreb)
#### Post date: [October 9, 2023, 4:39pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/2 "2023-10-09T16:39:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [October 9, 2023, 6:29pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/3 "2023-10-09T18:29:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![csaavedra](https://community.metabrainz.org/user_avatar/community.metabrainz.org/csaavedra/32/65091_2.png) [@csaavedra](https://community.metabrainz.org/u/csaavedra)
#### Post date: [October 10, 2023, 9:44am UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/4 "2023-10-10T09:44:44Z")

</div>

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

---

<div class="post-metadata">

### Author: ![elomatreb](https://community.metabrainz.org/user_avatar/community.metabrainz.org/elomatreb/32/44009_2.png) [@elomatreb](https://community.metabrainz.org/u/elomatreb)
#### Post date: [October 10, 2023, 4:30pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/5 "2023-10-10T16:30:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [October 25, 2023, 2:15pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/6 "2023-10-25T14:15:24Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![rob](https://community.metabrainz.org/user_avatar/community.metabrainz.org/rob/32/29_2.png) [@rob](https://community.metabrainz.org/u/rob)
#### Post date: [October 25, 2023, 2:27pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/7 "2023-10-25T14:27:25Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![lucifer](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/l/ad7895/32.png) [@lucifer](https://community.metabrainz.org/u/lucifer)
#### Post date: [October 25, 2023, 9:09pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/8 "2023-10-25T21:09:50Z")

</div>

@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.

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [October 26, 2023, 4:05pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/9 "2023-10-26T16:05:43Z")

</div>

I opened [Docs: Clarify that listened\_at should be set to start of playback by phw · Pull Request #2607 · metabrainz/listenbrainz-server · GitHub](https://github.com/metabrainz/listenbrainz-server/pull/2607) to update the docs to clarify this.

---

<div class="post-metadata">

### Author: ![outsidecontext](https://community.metabrainz.org/user_avatar/community.metabrainz.org/outsidecontext/32/90_2.png) [@outsidecontext](https://community.metabrainz.org/u/outsidecontext)
#### Post date: [October 27, 2023, 2:03pm UTC](https://community.metabrainz.org/t/listened-at-parameter-for-submissions-specification-unclear/659142/10 "2023-10-27T14:03:37Z")

</div>

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.
