MacOS auth for Spotify

This commit is contained in:
philippe44
2023-07-25 19:08:30 -07:00
parent 8b764c0c2d
commit bdceb2d832
7 changed files with 106 additions and 51 deletions

View File

@@ -1,13 +1,10 @@
#pragma once
#include <atomic> // or std::atomic
#include <functional> // for function
#include <memory> // for shared_ptr
#include <string> // for string
#include <atomic>
namespace bell {
class WrappedSemaphore;
};
namespace cspot {
struct Context;
@@ -35,7 +32,6 @@ class AccessKeyFetcher {
private:
std::shared_ptr<cspot::Context> ctx;
std::shared_ptr<bell::WrappedSemaphore> updateSemaphore;
std::atomic<bool> keyPending = false;
std::string accessKey;

View File

@@ -1,5 +1,6 @@
#pragma once
#include <stdint.h>
#include <memory>
#include "LoginBlob.h"
@@ -14,6 +15,7 @@ struct Context {
AudioFormat audioFormat = AudioFormat::AudioFormat_OGG_VORBIS_160;
std::string deviceId;
std::string deviceName;
std::vector<uint8_t> authData;
int volume;
std::string username;
@@ -33,6 +35,7 @@ struct Context {
ctx->session = std::make_shared<MercurySession>(ctx->timeProvider);
ctx->config.deviceId = blob->getDeviceId();
ctx->config.deviceName = blob->getDeviceName();
ctx->config.authData = blob->authData;
ctx->config.volume = 0;
ctx->config.username = blob->getUserName();