mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 13:07:03 +03:00
finhsing CSpot integration
This commit is contained in:
@@ -182,6 +182,7 @@ void SpircController::handleFrame(std::vector<uint8_t> &data) {
|
||||
}
|
||||
|
||||
void SpircController::loadTrack(uint32_t position_ms, bool isPaused) {
|
||||
sendEvent(CSpotEventType::LOAD, (int) position_ms);
|
||||
state->setPlaybackState(PlaybackState::Loading);
|
||||
std::function<void()> loadedLambda = [=]() {
|
||||
// Loading finished, notify that playback started
|
||||
@@ -216,6 +217,7 @@ void SpircController::setEventHandler(cspotEventHandler callback) {
|
||||
info.artist = track.artist;
|
||||
info.imageUrl = track.imageUrl;
|
||||
info.name = track.name;
|
||||
info.duration = track.duration;
|
||||
|
||||
this->sendEvent(CSpotEventType::TRACK_INFO, info);
|
||||
});
|
||||
|
||||
@@ -99,12 +99,13 @@ void SpotifyTrack::trackInformationCallback(std::unique_ptr<MercuryResponse> res
|
||||
|
||||
if (trackInfoReceived != nullptr)
|
||||
{
|
||||
CSPOT_LOG(info, "Calling %d", trackInfo.album.value().cover_group.value().image.size());
|
||||
TrackInfo simpleTrackInfo = {
|
||||
.name = trackInfo.name.value(),
|
||||
.album = trackInfo.album.value().name.value(),
|
||||
.artist = trackInfo.artist[0].name.value(),
|
||||
.imageUrl = "https://i.scdn.co/image/" + bytesToHexString(trackInfo.album.value().cover_group.value().image[0].file_id.value())
|
||||
.imageUrl = "https://i.scdn.co/image/" + bytesToHexString(trackInfo.album.value().cover_group.value().image[0].file_id.value()),
|
||||
.duration = trackInfo.duration.value(),
|
||||
|
||||
};
|
||||
|
||||
trackInfoReceived(simpleTrackInfo);
|
||||
|
||||
Reference in New Issue
Block a user