[PR #94] [CLOSED] Fix deserializing Audio Analysis response #239

Closed
opened 2026-02-27 20:23:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/94
Author: @Rigellute
Created: 4/28/2020
Status: Closed

Base: masterHead: master


📝 Commits (2)

  • 62e5ac2 Update timestamp field to be a string
  • 8d15009 Make all analysis fields optional

📊 Changes

1 file changed (+54 additions, -54 deletions)

View changed files

📝 src/model/audio.rs (+54 -54)

📄 Description

It seems the spotify API has changed their responses from the audio_analysis endpoint.

A number of fields seem to be missing and/or have different types now - some numbers are now contained in strings e.g. timestamp.

I've gone the heavy handed route and made all the fields optional. I started trying to only make certain fields optional but this was hit and miss as I tried other tracks.

Perhaps there is a better solution?

The errors can be reproduced by running

cargo run --example audio_analysis

This should close #93


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/94 **Author:** [@Rigellute](https://github.com/Rigellute) **Created:** 4/28/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`62e5ac2`](https://github.com/ramsayleung/rspotify/commit/62e5ac2a45a03feabd4d5ca35d6b07cda6afa409) Update `timestamp` field to be a string - [`8d15009`](https://github.com/ramsayleung/rspotify/commit/8d15009ea8e457ef5827334f22fef7e55b34c6b3) Make all analysis fields optional ### 📊 Changes **1 file changed** (+54 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `src/model/audio.rs` (+54 -54) </details> ### 📄 Description It seems the spotify API has changed their responses from the audio_analysis endpoint. A number of fields seem to be missing and/or have different types now - some numbers are now contained in strings e.g. `timestamp`. I've gone the heavy handed route and made all the fields optional. I started trying to only make certain fields optional but this was hit and miss as I tried other tracks. Perhaps there is a better solution? The errors can be reproduced by running ``` cargo run --example audio_analysis ``` This should close #93 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:23:54 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#239
No description provided.