@@ -21,7 +21,7 @@ PlayerAPI::PlayerAPI(Spotify *parent) : m_spotify(parent)
21
21
22
22
auto PlayerAPI::play () const -> QFuture<RestReply>
23
23
{
24
- return m_spotify->put (QUrl (u" https://api.spotify.com/v1/me/player/play" _s), {}, Option::Authenticated);
24
+ return m_spotify->put (QUrl (u" https://api.spotify.com/v1/me/player/play" _s), {}, Services:: Option::Authenticated);
25
25
}
26
26
27
27
auto PlayerAPI::play (const QString &deviceId, const QJsonObject &body) const -> QFuture<RestReply>
@@ -36,7 +36,7 @@ auto PlayerAPI::play(const QString &deviceId, const QJsonObject &body) const ->
36
36
37
37
const QJsonDocument content (body);
38
38
return m_spotify->put (NetworkUtils::makeJsonRequest (url), content.toJson (QJsonDocument::JsonFormat::Compact),
39
- Option::Authenticated);
39
+ Services:: Option::Authenticated);
40
40
}
41
41
42
42
auto PlayerAPI::play (const QString &uri) const -> QFuture<RestReply>
@@ -99,7 +99,7 @@ auto PlayerAPI::pause(const QString &deviceId) const -> QFuture<RestReply>
99
99
url.setQuery (query);
100
100
}
101
101
102
- return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
102
+ return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
103
103
}
104
104
105
105
auto PlayerAPI::next () const -> QFuture<RestReply>
@@ -117,7 +117,7 @@ auto PlayerAPI::next(const QString &deviceId) const -> QFuture<RestReply>
117
117
url.setQuery (query);
118
118
}
119
119
120
- return m_spotify->post (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
120
+ return m_spotify->post (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
121
121
}
122
122
123
123
auto PlayerAPI::previous () const -> QFuture<RestReply>
@@ -135,7 +135,7 @@ auto PlayerAPI::previous(const QString &deviceId) const -> QFuture<RestReply>
135
135
url.setQuery (query);
136
136
}
137
137
138
- return m_spotify->post (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
138
+ return m_spotify->post (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
139
139
}
140
140
141
141
auto PlayerAPI::seek (int positionMs) const -> QFuture<RestReply>
@@ -155,7 +155,7 @@ auto PlayerAPI::seek(int positionMs, const QString &deviceId) const -> QFuture<R
155
155
156
156
url.setQuery (query);
157
157
158
- return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
158
+ return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
159
159
}
160
160
161
161
auto PlayerAPI::getState () -> QFuture<SpotifyPlaybackState>
@@ -190,7 +190,7 @@ auto PlayerAPI::getState(const QStringList &additionalTypes, const QString &mark
190
190
return QtFuture::makeReadyFuture (SpotifyPlaybackState::fromJson (QJsonDocument::fromJson (reply.data ())));
191
191
};
192
192
193
- return m_spotify->get (NetworkUtils::makeJsonRequest (url), Option::Authenticated).then (callback).unwrap ();
193
+ return m_spotify->get (NetworkUtils::makeJsonRequest (url), Services:: Option::Authenticated).then (callback).unwrap ();
194
194
}
195
195
196
196
auto PlayerAPI::getCurrentlyPlaying () -> QFuture<SpotifyCurrentTrack>
@@ -227,7 +227,7 @@ auto PlayerAPI::getCurrentlyPlaying(const QStringList &additionalTypes, const QS
227
227
return QtFuture::makeReadyFuture (SpotifyCurrentTrack::fromJson (reply.data ()));
228
228
};
229
229
230
- return m_spotify->get (NetworkUtils::makeJsonRequest (url), Option::Authenticated).then (callback).unwrap ();
230
+ return m_spotify->get (NetworkUtils::makeJsonRequest (url), Services:: Option::Authenticated).then (callback).unwrap ();
231
231
}
232
232
233
233
auto PlayerAPI::transfer (const QStringList &deviceIds) const -> QFuture<RestReply>
@@ -243,7 +243,7 @@ auto PlayerAPI::transfer(const QStringList &deviceIds, bool play) const -> QFutu
243
243
244
244
const auto doc = QJsonDocument (body);
245
245
return m_spotify->put (NetworkUtils::makeJsonRequest (url), doc.toJson (QJsonDocument::Compact),
246
- Option::Authenticated);
246
+ Services:: Option::Authenticated);
247
247
}
248
248
249
249
auto PlayerAPI::devices () -> QFuture<SpotifyDeviceList>
@@ -256,7 +256,7 @@ auto PlayerAPI::devices() -> QFuture<SpotifyDeviceList>
256
256
return SpotifyDevice::fromJson (devices);
257
257
};
258
258
259
- return m_spotify->get (NetworkUtils::makeJsonRequest (url), Option::Authenticated).then (callback);
259
+ return m_spotify->get (NetworkUtils::makeJsonRequest (url), Services:: Option::Authenticated).then (callback);
260
260
}
261
261
262
262
auto PlayerAPI::repeat (SpotifyRepeatMode mode) const -> QFuture<RestReply>
@@ -291,7 +291,7 @@ auto PlayerAPI::repeat(const QString &state, const QString &deviceId) const -> Q
291
291
}
292
292
293
293
url.setQuery (query);
294
- return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
294
+ return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
295
295
}
296
296
297
297
auto PlayerAPI::volume (int volumePercent) const -> QFuture<RestReply>
@@ -310,7 +310,7 @@ auto PlayerAPI::volume(int volumePercent, const QString &deviceId) const -> QFut
310
310
}
311
311
312
312
url.setQuery (query);
313
- return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
313
+ return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
314
314
}
315
315
316
316
auto PlayerAPI::shuffle (bool state) const -> QFuture<RestReply>
@@ -329,7 +329,7 @@ auto PlayerAPI::shuffle(bool state, const QString &deviceId) const -> QFuture<Re
329
329
}
330
330
331
331
url.setQuery (query);
332
- return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
332
+ return m_spotify->put (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
333
333
}
334
334
335
335
auto PlayerAPI::getRecentlyPlayed (int limit) const -> QFuture<RestReply>
@@ -364,7 +364,8 @@ auto PlayerAPI::getRecentlyPlayed(const QDateTime &after, const QDateTime &befor
364
364
query.addQueryItem (u" limit" _s, QString::number (std::clamp (limit, 0 , MAX_RECENTLY_PLAYED)));
365
365
366
366
url.setQuery (query);
367
- return m_spotify->get (NetworkUtils::makeJsonRequest (url), Option::Authenticated | Option::LowPriority);
367
+ return m_spotify->get (NetworkUtils::makeJsonRequest (url),
368
+ Services::Option::Authenticated | Services::Option::LowPriority);
368
369
}
369
370
370
371
auto PlayerAPI::addToQueue (const QString &uri) const -> QFuture<RestReply>
@@ -390,5 +391,5 @@ auto PlayerAPI::addToQueue(const QString &uri, const QString &deviceId) const ->
390
391
}
391
392
392
393
url.setQuery (query);
393
- return m_spotify->post (NetworkUtils::makeJsonRequest (url), {}, Option::Authenticated);
394
+ return m_spotify->post (NetworkUtils::makeJsonRequest (url), {}, Services:: Option::Authenticated);
394
395
}
0 commit comments