mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-12-17 05:28:17 +00:00
fix: subscription groups use invalid channel id length
This commit is contained in:
22
src/main.js
22
src/main.js
@@ -236,6 +236,28 @@ const mixin = {
|
||||
const localSubscriptions = this.getLocalSubscriptions() ?? [];
|
||||
return localSubscriptions.join(",");
|
||||
},
|
||||
async fetchSubscriptions() {
|
||||
if (this.authenticated) {
|
||||
return await this.fetchJson(this.authApiUrl() + "/subscriptions", null, {
|
||||
headers: {
|
||||
Authorization: this.getAuthToken(),
|
||||
},
|
||||
});
|
||||
} else {
|
||||
const 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(),
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
/* generate a temporary file and ask the user to download it */
|
||||
download(text, filename, mimeType) {
|
||||
var file = new Blob([text], { type: mimeType });
|
||||
|
||||
Reference in New Issue
Block a user