feat: Add quality and bitrate params to summary object

This commit is contained in:
Xoconoch
2025-08-20 09:27:36 -05:00
parent fb2e5d0800
commit e4a948cd2a
4 changed files with 146 additions and 4 deletions

View File

@@ -2,7 +2,9 @@
This document provides examples for all possible callback JSON objects as generated by `deezspot`. These examples are based on the dataclasses defined in `deezspot/models/callback/`.
These callbacks are service-agnostic, which means they will have the same exact format regardless of the service used. Basically: one interface to rule them both.
These callbacks are service-agnostic, which means they will have the same exact format regardless of the service used. Basically: one interface to rule them both.
When a `summary` is included, it specifies the source service via a `service` field (either `spotify` or `deezer`). It also includes final media characteristics: `quality` (final format, lowercase like "mp3", "flac", "ogg") and `bitrate` (e.g., "320k").
However, don't be so confident this will perfectly unify both service's APIs, since there are still key differences in the metadata itself, for example: in spotify, certain band shows up as [Man**á**](https://open.spotify.com/artist/7okwEbXzyT2VffBmyQBWLz) but in deezer it shows up as [Man**a**](https://www.deezer.com/us/artist/4115). There's really nothing to be done in those cases other than deal with it, since the inconsistency is not a matter of _how_ the services store their data but literally _what_ data they store.
@@ -576,7 +578,7 @@ Indicates that the track has been processed successfully.
}
```
Note: When a single-track operation is performed (not part of an album/playlist), the `summary` field may be populated. In that case, it can also include `final_path` and `download_quality` as additional convenience fields mirroring `status_info`.
Note: When a single-track operation is performed (not part of an album/playlist), the `summary` field may be populated. In that case, it can also include `final_path`, `download_quality`, `service`, `quality`, and `bitrate` as additional convenience fields indicating the final output.
## `albumCallbackObject` Examples
@@ -722,7 +724,10 @@ The `done` status for an album includes a summary of all track operations.
"failed_tracks": [],
"total_successful": 1,
"total_skipped": 0,
"total_failed": 0
"total_failed": 0,
"service": "spotify",
"quality": "ogg",
"bitrate": "320k"
},
"ids": {
"spotify": "6l8GvAOfAccdwJAIF13j3m"
@@ -887,7 +892,10 @@ The `done` status for a playlist includes a summary of all track operations.
"total_successful": 1,
"total_skipped": 0,
"total_failed": 1,
"m3u_path": "/playlists/Classic Rock Anthems.m3u"
"m3u_path": "/playlists/Classic Rock Anthems.m3u",
"service": "spotify",
"quality": "ogg",
"bitrate": "320k"
},
"ids": {
"spotify": "37i9dQZF1DX1rVvRgjX59F"