mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Allow loading large amount of unauth subscriptions through POST method.
This commit is contained in:
		
							parent
							
								
									b6a78a7be3
								
							
						
					
					
						commit
						f2679c4813
					
				
					 2 changed files with 24 additions and 6 deletions
				
			
		| 
						 | 
					@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue