Skip to content

SpotifyAPI.Web.SpotifyClient.Library.SaveItems error #1045

Description

@eliaskokkalis
1 public bool AddTracksToLibrary(List<string> trackIds)
2 {
3  if (trackIds == null || trackIds.Count == 0)
4     return true;
5   return spotifyClient.Library.SaveItems(new LibrarySaveItemsRequest(trackIds.Select(x => $"spotify:track:{x}").ToList())).Result;
6 }

This code throws error on line 5:
"Missing required field: uris"
stack trace:
at SpotifyAPI.Web.Http.APIConnector.ProcessErrors(IResponse response)
at SpotifyAPI.Web.Http.APIConnector.d__31.MoveNext()
at SpotifyAPI.Web.Http.APIConnector.d__30`1.MoveNext()
at SpotifyAPI.Web.Http.APIConnector.d__35.MoveNext()
at SpotifyAPI.Web.Http.APIConnector.d__26.MoveNext()
at SpotifyAPI.Web.LibraryClient.d__25.MoveNext()

The error is in SaveItems. Its argument contains Uris

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions