mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
non-crashing CSpot + spi_master and override fixes
This commit is contained in:
@@ -35,8 +35,8 @@ SpotifyTrack::~SpotifyTrack()
|
||||
{
|
||||
this->manager->unregisterMercuryCallback(this->reqSeqNum);
|
||||
this->manager->freeAudioKeyCallback();
|
||||
pbFree(Track_fields, &this->trackInfo);
|
||||
pbFree(Episode_fields, &this->episodeInfo);
|
||||
pb_release(Track_fields, this->trackInfo);
|
||||
pb_release(Episode_fields, this->episodeInfo);
|
||||
}
|
||||
|
||||
bool SpotifyTrack::countryListContains(std::string countryList, std::string country)
|
||||
@@ -142,6 +142,21 @@ void SpotifyTrack::episodeInformationCallback(std::unique_ptr<MercuryResponse> r
|
||||
}
|
||||
}
|
||||
|
||||
if (trackInfoReceived != nullptr)
|
||||
{
|
||||
auto imageId = pbArrayToVector(episodeInfo.covers->image[0].file_id);
|
||||
TrackInfo simpleTrackInfo = {
|
||||
.name = std::string(episodeInfo.name),
|
||||
.album = "",
|
||||
.artist = "",
|
||||
.imageUrl = "https://i.scdn.co/image/" + bytesToHexString(imageId),
|
||||
.duration = trackInfo.duration,
|
||||
|
||||
};
|
||||
|
||||
trackInfoReceived(simpleTrackInfo);
|
||||
}
|
||||
|
||||
this->requestAudioKey(pbArrayToVector(episodeInfo.gid), this->fileId, episodeInfo.duration, position_ms, isPaused);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user