mirror of
https://github.com/ramsayleung/rspotify.git
synced 2026-04-26 07:55:55 +03:00
[PR #480] [MERGED] fix: deserialize empty images from null #484
Labels
No labels
Stale
bug
discussion
enhancement
good first issue
good first issue
help wanted
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/rspotify#484
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ramsayleung/rspotify/pull/480
Author: @plustik
Created: 4/29/2024
Status: ✅ Merged
Merged: 5/2/2024
Merged by: @ramsayleung
Base:
master← Head:fix/serializing-null-images📝 Commits (1)
cc507a8fix: deserialize empty images from null📊 Changes
1 file changed (+9 additions, -0 deletions)
View changed files
📝
rspotify-model/src/playlist.rs(+9 -0)📄 Description
Description
Adjust the derived implementation of
DeserializeforSimplifiedPlaylist. Instead of returning an error when deserializing the valuenullfor the fieldimages, this value is deserialized to an emptyVec.This is necessary, because the Spotify-API is returning
nullinstead of an empty array for this field in some instances.Motivation and Context
This fixes the problem described in https://github.com/ramsayleung/rspotify/issues/459. The Spotify-API is returning
nullinstead of an empty array for theimages-field in some instances.Dependencies
None
Type of change
Please delete options that are not relevant.
How has this been tested?
The change was tested by using the patched version of rspotify in this project.
Is this change properly documented?
I don't think this needs to be documented. The change won't affect the behavior of rspotify when the Spotify-API returns
images: []. When the Spotify-API returnsimages: nullcurrent_user_playlistswasn't usable prior to this change. In this case the PR implements the expected behavior.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.