Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Compliance Issue With ListenBrainz API #388

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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"
    },

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.

1 participant