mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-05-16 19:41:22 +00:00
Allow loading large amount of unauth subscriptions through POST method.
This commit is contained in:
parent
b6a78a7be3
commit
f2679c4813
@ -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() {
|
||||||
|
@ -166,11 +166,20 @@ export default {
|
|||||||
Authorization: this.getAuthToken(),
|
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 {
|
} else {
|
||||||
return await this.fetchJson(this.authApiUrl() + "/subscriptions/unauthenticated", {
|
return await this.fetchJson(this.authApiUrl() + "/subscriptions/unauthenticated", {
|
||||||
channels: this.getUnauthenticatedChannels(),
|
channels: this.getUnauthenticatedChannels(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async loadChannelGroups() {
|
async loadChannelGroups() {
|
||||||
const groups = await this.getChannelGroups();
|
const groups = await this.getChannelGroups();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user