mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-10 02:08:21 +00:00
Adapt and simply channel and playlist continuations.
This commit is contained in:
parent
20d7764930
commit
db5681297f
@ -66,21 +66,18 @@ export default {
|
|||||||
.then(() => (document.title = this.channel.name + " - Piped"));
|
.then(() => (document.title = this.channel.name + " - Piped"));
|
||||||
},
|
},
|
||||||
handleScroll() {
|
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) {
|
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - window.innerHeight) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.fetchJson(
|
this.fetchJson(
|
||||||
Constants.BASE_URL +
|
Constants.BASE_URL +
|
||||||
"/nextpage/channels/" +
|
"/nextpage/channels/" +
|
||||||
this.channel.id +
|
this.channel.id +
|
||||||
"?url=" +
|
"?nextpage=" +
|
||||||
encodeURIComponent(this.channel.nextpage) +
|
encodeURIComponent(this.channel.nextpage),
|
||||||
"&id=" +
|
|
||||||
encodeURIComponent(this.channel.nextbody),
|
|
||||||
).then(json => {
|
).then(json => {
|
||||||
this.channel.relatedStreams.concat(json.relatedStreams);
|
this.channel.relatedStreams.concat(json.relatedStreams);
|
||||||
this.channel.nextpage = json.nextpage;
|
this.channel.nextpage = json.nextpage;
|
||||||
this.channel.nextbody = json.nextbody;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
json.relatedStreams.map(stream => this.channel.relatedStreams.push(stream));
|
json.relatedStreams.map(stream => this.channel.relatedStreams.push(stream));
|
||||||
});
|
});
|
||||||
|
@ -68,21 +68,18 @@ 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 || !this.playlist.nextbody) return;
|
if (this.loading || !this.playlist || !this.playlist.nextpage) return;
|
||||||
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - window.innerHeight) {
|
if (window.innerHeight + window.scrollY >= document.body.offsetHeight - window.innerHeight) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.fetchJson(
|
this.fetchJson(
|
||||||
Constants.BASE_URL +
|
Constants.BASE_URL +
|
||||||
"/nextpage/playlists/" +
|
"/nextpage/playlists/" +
|
||||||
this.$route.query.list +
|
this.$route.query.list +
|
||||||
"?url=" +
|
"?nextpage=" +
|
||||||
encodeURIComponent(this.playlist.nextpage) +
|
encodeURIComponent(this.playlist.nextpage),
|
||||||
"&id=" +
|
|
||||||
encodeURIComponent(this.playlist.nextbody),
|
|
||||||
).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.nextbody = json.nextbody;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
json.relatedStreams.map(stream => this.playlist.relatedStreams.push(stream));
|
json.relatedStreams.map(stream => this.playlist.relatedStreams.push(stream));
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user