Fix playlist continuation.

This commit is contained in:
FireMasterK 2021-03-30 15:09:23 +05:30
parent d93d05d424
commit 78dff1491b
No known key found for this signature in database
GPG Key ID: 8DFF5DD33E93DB58

View File

@ -82,7 +82,12 @@ export default {
.then(() => (document.title = this.playlist.name + " - Piped")); .then(() => (document.title = this.playlist.name + " - Piped"));
}, },
handleScroll() { handleScroll() {
if (this.loading || !this.playlist || !this.playlist.nextpage) if (
this.loading ||
!this.playlist ||
!this.playlist.nextpage ||
!this.playlist.nextid
)
return; return;
if ( if (
window.innerHeight + window.scrollY >= window.innerHeight + window.scrollY >=
@ -94,10 +99,13 @@ export default {
"/nextpage/playlists/" + "/nextpage/playlists/" +
this.$route.query.list + this.$route.query.list +
"?url=" + "?url=" +
encodeURIComponent(this.playlist.nextpage) encodeURIComponent(this.playlist.nextpage) +
"&id=" +
encodeURIComponent(this.playlist.nextid)
).then(json => { ).then(json => {
this.playlist.relatedStreams.concat(json.relatedStreams); this.playlist.relatedStreams.concat(json.relatedStreams);
this.playlist.nextpage = json.nextpage; this.playlist.nextpage = json.nextpage;
this.playlist.nextid = json.nextid;
this.loading = false; this.loading = false;
json.relatedStreams.map(stream => json.relatedStreams.map(stream =>
this.playlist.relatedStreams.push(stream) this.playlist.relatedStreams.push(stream)