Twitch API: v5 to Helix migration (#1560)

There's a document in src/providers/twitch/api which describes how we interact with the Twitch API.
Keeping this up to date might be a healthy way for us to ensure we keep using the right APIs for the right job.
This commit is contained in:
pajlada
2020-03-14 07:13:57 -04:00
committed by GitHub
parent 2e39dd4d9b
commit 9a8b85e338
25 changed files with 1076 additions and 572 deletions
-21
View File
@@ -4,7 +4,6 @@
#include "common/Common.hpp"
#include "common/NetworkRequest.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "providers/twitch/PartialTwitchUser.hpp"
#include "util/Helpers.hpp"
#ifdef USEWINSDK
@@ -159,7 +158,6 @@ AdvancedLoginWidget::AdvancedLoginWidget()
this->ui_.layout.addWidget(&this->ui_.instructionsLabel);
this->ui_.layout.addLayout(&this->ui_.formLayout);
this->ui_.layout.addLayout(&this->ui_.buttonUpperRow.layout);
this->ui_.layout.addLayout(&this->ui_.buttonLowerRow.layout);
this->refreshButtons();
@@ -207,29 +205,10 @@ AdvancedLoginWidget::AdvancedLoginWidget()
LogInWithCredentials(userID, username, clientID, oauthToken);
});
/// Lower button row
this->ui_.buttonLowerRow.fillInUserIDButton.setText(
"Get user ID from username");
this->ui_.buttonLowerRow.layout.addWidget(
&this->ui_.buttonLowerRow.fillInUserIDButton);
connect(&this->ui_.buttonLowerRow.fillInUserIDButton, &QPushButton::clicked,
[=]() {
const auto onIdFetched = [=](const QString &userID) {
this->ui_.userIDInput.setText(userID); //
};
PartialTwitchUser::byName(this->ui_.usernameInput.text())
.getId(onIdFetched, this);
});
}
void AdvancedLoginWidget::refreshButtons()
{
this->ui_.buttonLowerRow.fillInUserIDButton.setEnabled(
!this->ui_.usernameInput.text().isEmpty());
if (this->ui_.userIDInput.text().isEmpty() ||
this->ui_.usernameInput.text().isEmpty() ||
this->ui_.clientIDInput.text().isEmpty() ||