Skip to content

Conversation

@Menghini
Copy link

@Menghini Menghini commented Dec 8, 2024

According to The Official ListenBrainz Documentation (page 89), the duration of a song is either duration and duration_ms, but not both. Maloja was only looking for duration and this caused issues with Navidrome as it reported duration_ms instead of duration so it would always be null. This would correct that issue.

@Menghini
Copy link
Author

Menghini commented Dec 9, 2024

On second thought, in order to align more closely with Spotify request, I changed track_length to scrobble_duration which seems more likely to fit.
Example from Navidrome:

    {
      "time": 1733757481,
      "track": {
        "artists": [
          "Kazumi Totaka"
        ],
        "title": "Bees!",
        "album": {
          "artists": [
            "Kazumi Totaka"
          ],
          "albumtitle": "Animal Crossing"
        },
        "length": null
      },
      "duration": 38560,
      "origin": "client:navidrome"
    },

Example from Spotify:

    {
      "time": 1733744505,
      "track": {
        "artists": [
          "Ethan Slater",
          "Marissa Bode",
          "Ariana Grande",
          "Cynthia Erivo",
          "Jonathan Bailey"
        ],
        "title": "Dancing Through Life",
        "album": {
          "artists": [
            "Ariana Grande",
            "Cynthia Erivo",
            "Wicked Movie Cast"
          ],
          "albumtitle": "Wicked: The Soundtrack"
        },
        "length": 587
      },
      "duration": 586,
      "origin": "client:spotify"
    },

@krateng
Copy link
Owner

krateng commented Jan 27, 2025

track_length refers to the actual full track, while scrobble_duration means how long it was listened to in this specific scrobble (ended early, skipped ahead etc.). The documentation to me sounds like it refers to the full track duration, is that not how it's used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants