From db5681297f7ca7b5cb3546be962f3b2457e54589 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Sun, 6 Jun 2021 01:05:14 +0530 Subject: [PATCH] Adapt and simply channel and playlist continuations. --- src/components/Channel.vue | 9 +++------ src/components/Playlist.vue | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/components/Channel.vue b/src/components/Channel.vue index fb3f56c9..f8282fb7 100644 --- a/src/components/Channel.vue +++ b/src/components/Channel.vue @@ -66,21 +66,18 @@ export default { .then(() => (document.title = this.channel.name + " - Piped")); }, handleScroll() { - if (this.loading || !this.channel || !this.channel.nextpage || !this.channel.nextbody) return; + if (this.loading || !this.channel || !this.channel.nextpage) return; if (window.innerHeight + window.scrollY >= document.body.offsetHeight - window.innerHeight) { this.loading = true; this.fetchJson( Constants.BASE_URL + "/nextpage/channels/" + this.channel.id + - "?url=" + - encodeURIComponent(this.channel.nextpage) + - "&id=" + - encodeURIComponent(this.channel.nextbody), + "?nextpage=" + + encodeURIComponent(this.channel.nextpage), ).then(json => { this.channel.relatedStreams.concat(json.relatedStreams); this.channel.nextpage = json.nextpage; - this.channel.nextbody = json.nextbody; this.loading = false; json.relatedStreams.map(stream => this.channel.relatedStreams.push(stream)); }); diff --git a/src/components/Playlist.vue b/src/components/Playlist.vue index df68c214..cdecbc10 100644 --- a/src/components/Playlist.vue +++ b/src/components/Playlist.vue @@ -68,21 +68,18 @@ export default { .then(() => (document.title = this.playlist.name + " - Piped")); }, handleScroll() { - if (this.loading || !this.playlist || !this.playlist.nextpage || !this.playlist.nextbody) return; + if (this.loading || !this.playlist || !this.playlist.nextpage) return; if (window.innerHeight + window.scrollY >= document.body.offsetHeight - window.innerHeight) { this.loading = true; this.fetchJson( Constants.BASE_URL + "/nextpage/playlists/" + this.$route.query.list + - "?url=" + - encodeURIComponent(this.playlist.nextpage) + - "&id=" + - encodeURIComponent(this.playlist.nextbody), + "?nextpage=" + + encodeURIComponent(this.playlist.nextpage), ).then(json => { this.playlist.relatedStreams.concat(json.relatedStreams); this.playlist.nextpage = json.nextpage; - this.playlist.nextbody = json.nextbody; this.loading = false; json.relatedStreams.map(stream => this.playlist.relatedStreams.push(stream)); });