Allow loading large amount of unauth subscriptions through POST method.

This commit is contained in:
Kavin 2024-01-03 20:45:28 +00:00
parent b6a78a7be3
commit f2679c4813
No known key found for this signature in database
GPG Key ID: 6E4598CA5C92C41F
2 changed files with 24 additions and 6 deletions

View File

@ -124,9 +124,18 @@ export default {
authToken: this.getAuthToken(), authToken: this.getAuthToken(),
}); });
} else { } else {
return await this.fetchJson(this.authApiUrl() + "/feed/unauthenticated", { const channels = this.getUnauthenticatedChannels();
channels: this.getUnauthenticatedChannels(), const split = channels.split(",");
}); if (split.length > 100) {
return await this.fetchJson(this.authApiUrl() + "/feed/unauthenticated", null, {
method: "POST",
body: JSON.stringify(split),
});
} else {
return await this.fetchJson(this.authApiUrl() + "/feed/unauthenticated", {
channels: channels,
});
}
} }
}, },
async loadChannelGroups() { async loadChannelGroups() {

View File

@ -167,9 +167,18 @@ export default {
}, },
}); });
} else { } else {
return await this.fetchJson(this.authApiUrl() + "/subscriptions/unauthenticated", { const channels = this.getUnauthenticatedChannels();
channels: this.getUnauthenticatedChannels(), const split = channels.split(",");
}); if (split.length > 100) {
return await this.fetchJson(this.authApiUrl() + "/subscriptions/unauthenticated", null, {
method: "POST",
body: JSON.stringify(split),
});
} else {
return await this.fetchJson(this.authApiUrl() + "/subscriptions/unauthenticated", {
channels: this.getUnauthenticatedChannels(),
});
}
} }
}, },
async loadChannelGroups() { async loadChannelGroups() {