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

Update the mappings to match current API results #50

Merged
merged 5 commits into from
Dec 24, 2023
Merged

Conversation

Zastai
Copy link
Owner

@Zastai Zastai commented Dec 24, 2023

This adjusts the processing to handle the current structures returned by the ListenBrainz API. This should resolve all cases where the UnhandledProperties field was non-null before.

  • IArtistCountryInfo now includes an Artists property, which will have IArtistInfo instances for all listened-to artists from that country
  • IArtistInfo now includes an Id property, containing a single MusicBrainz ID
    • this may fully replace the existing multi-valued Ids property; once confirmed, that will be marked [Obsolete]
  • IFetchedListens now has an Oldest property, containing the timestamp of the user's oldest recorded listen
    • the existing Timestamp property was renamed to Newest
      • the documentation for Newest has been corrected as well; it is the timestamp of the user's newest recorded listen, unrelated to the range returned by that specific call
    • the existing UnixTimestamp property was dropped (all targeted frameworks allow easy conversion of the DateTimeOffset to a Unix time value)
  • similarly, IListen has its Timestamp property renamed to ListenedAt, and the UnixTimestamp property dropped
  • IMusicBrainzIdMappings has a new RecordingName property
  • there is a new IArtistCredit type, with information about a MusicBrainz artist credit
  • IMusicBrainzIdMappings, IRecordingInfo and IReleaseInfo have three new properties:
    • CoverArtId: the numeric ID of the associated CoverArt Archive entry
    • CoverArtReleaseId: the MusicBrainz ID of the release linked to the associated CoverArt Archive entry
    • Credits: a list of associated artist credits

Fixes #47.

The current API seems to return a single ID instead of a list.
While originally you only got a count of artists for each country, this
has now been expanded to also provide basic information about those
artists.
As part of this, the following breaking changes were made to the API:

- renamed `IFetchedListens.Timestamp` to `IFetchedListens.Newest` (and
  added `IFetchedListens.Oldest`)
  - the doc comments were also updated; these timestamps are always the
    newest/oldest listens in the entire dataset, not limited to the
    requested range
- renamed `IListen.Timestamp` to `IListed.ListenedAt`
- dropped `IFetchedListens.UnixTimestamp` and `IListen.UnixTimestamp`
  - only the properties of type `DateTimeOffset` are retained
These are:

- `Credits`, a list of artist credits
  - these include the MusicBrainz ID of an artist, the name under which
    that artist was credited, and a join phrase which either links to
    the next artist in the credit (e.g. "feat.") or ends the credit
    (e.g. "and friends")
- `CoverArtId`, the internal ID of the associated entry in the CoverArt
   Archive
- `CoverArtReleaseId`, the MusicBrainz ID of the release use for the
  associated entry in the CoverArt Archive
- `RecordingName`, the name of the recording in MusicBrainz
This adds the `Credits`, `CoverArtId` and `CoverArtReleaseId` fields,
as previously added to the MusicBrainz ID mappings.
@Zastai Zastai added breaking An incompatible change to a feature or API (requires a bump of the major version) feature A new feature or API was added (requires a bump of the minor version) fix Changes to fix broken behaviour labels Dec 24, 2023
@Zastai Zastai self-assigned this Dec 24, 2023
@Zastai Zastai merged commit 78f7ef1 into main Dec 24, 2023
2 checks passed
@Zastai Zastai deleted the update-mappings branch December 24, 2023 15:39
@Zastai Zastai removed the fix Changes to fix broken behaviour label Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking An incompatible change to a feature or API (requires a bump of the major version) feature A new feature or API was added (requires a bump of the minor version)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update processing to match current server behaviour
1 participant