mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Renamed new request function
This commit is contained in:
@@ -600,7 +600,7 @@ function sponsorsLookup(id: string, channelIDPromise?) {
|
|||||||
categories.push(categorySelection.name);
|
categories.push(categorySelection.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.requestToServer('GET', "/api/skipSegments", {
|
utils.asyncRequestToServer('GET', "/api/skipSegments", {
|
||||||
videoID: id,
|
videoID: id,
|
||||||
categories
|
categories
|
||||||
}).then(async (response: Response) => {
|
}).then(async (response: Response) => {
|
||||||
@@ -1578,7 +1578,7 @@ async function sendSubmitMessage(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Config.config.testingServer) {
|
if (Config.config.testingServer) {
|
||||||
let response = await utils.requestToServer("POST", "/api/skipSegments", {
|
let response = await utils.asyncRequestToServer("POST", "/api/skipSegments", {
|
||||||
videoID: sponsorVideoID,
|
videoID: sponsorVideoID,
|
||||||
userID: Config.config.userID,
|
userID: Config.config.userID,
|
||||||
segments: sponsorTimesSubmitting
|
segments: sponsorTimesSubmitting
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ class Utils {
|
|||||||
* @param address The address to add to the SponsorBlock server address
|
* @param address The address to add to the SponsorBlock server address
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
async requestToServer(type: string, address: string, data = {}) {
|
async asyncRequestToServer(type: string, address: string, data = {}) {
|
||||||
let serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress;
|
let serverAddress = Config.config.testingServer ? CompileConfig.testingServerAddress : Config.config.serverAddress;
|
||||||
|
|
||||||
// If GET, convert JSON to parameters
|
// If GET, convert JSON to parameters
|
||||||
|
|||||||
Reference in New Issue
Block a user