mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Play playlist in order
This commit is contained in:
parent
cc79eb5c6c
commit
8c89236989
2 changed files with 21 additions and 1 deletions
|
@ -69,6 +69,11 @@ export default {
|
||||||
async getPlaylistData() {
|
async getPlaylistData() {
|
||||||
this.fetchPlaylist()
|
this.fetchPlaylist()
|
||||||
.then(data => (this.playlist = data))
|
.then(data => (this.playlist = data))
|
||||||
|
.then(() =>
|
||||||
|
this.playlist.relatedStreams.forEach(video => {
|
||||||
|
video.url += "&list=" + this.$route.query.list;
|
||||||
|
}),
|
||||||
|
)
|
||||||
.then(() => (document.title = this.playlist.name + " - Piped"));
|
.then(() => (document.title = this.playlist.name + " - Piped"));
|
||||||
},
|
},
|
||||||
handleScroll() {
|
handleScroll() {
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
{{ showRecs ? $t("actions.minimize_recommendations") : $t("actions.show_recommendations") }}
|
{{ showRecs ? $t("actions.minimize_recommendations") : $t("actions.show_recommendations") }}
|
||||||
</a>
|
</a>
|
||||||
<div
|
<div
|
||||||
v-for="related in video.relatedStreams"
|
v-for="related in isPlaylist ? playlist.relatedStreams : video.relatedStreams"
|
||||||
v-show="showRecs || !smallView"
|
v-show="showRecs || !smallView"
|
||||||
:key="related.url"
|
:key="related.url"
|
||||||
class="uk-tile-default uk-width-auto"
|
class="uk-tile-default uk-width-auto"
|
||||||
|
@ -165,6 +165,9 @@ export default {
|
||||||
video: {
|
video: {
|
||||||
title: "Loading...",
|
title: "Loading...",
|
||||||
},
|
},
|
||||||
|
playlist: {
|
||||||
|
title: "Loading...",
|
||||||
|
},
|
||||||
sponsors: null,
|
sponsors: null,
|
||||||
selectedAutoLoop: false,
|
selectedAutoLoop: false,
|
||||||
selectedAutoPlay: null,
|
selectedAutoPlay: null,
|
||||||
|
@ -190,6 +193,9 @@ export default {
|
||||||
isEmbed(_this) {
|
isEmbed(_this) {
|
||||||
return String(_this.$route.path).indexOf("/embed/") == 0;
|
return String(_this.$route.path).indexOf("/embed/") == 0;
|
||||||
},
|
},
|
||||||
|
isPlaylist(_this) {
|
||||||
|
return _this.$route.query.list;
|
||||||
|
},
|
||||||
uploadDate(_this) {
|
uploadDate(_this) {
|
||||||
return new Date(_this.video.uploadDate).toLocaleString(undefined, {
|
return new Date(_this.video.uploadDate).toLocaleString(undefined, {
|
||||||
month: "short",
|
month: "short",
|
||||||
|
@ -228,6 +234,7 @@ export default {
|
||||||
})();
|
})();
|
||||||
if (this.active) this.$refs.videoPlayer.loadVideo();
|
if (this.active) this.$refs.videoPlayer.loadVideo();
|
||||||
});
|
});
|
||||||
|
this.getPlaylistData();
|
||||||
this.getSponsors();
|
this.getSponsors();
|
||||||
if (!this.isEmbed && this.getPreferenceBoolean("comments", true)) this.getComments();
|
if (!this.isEmbed && this.getPreferenceBoolean("comments", true)) this.getComments();
|
||||||
window.addEventListener("resize", () => {
|
window.addEventListener("resize", () => {
|
||||||
|
@ -266,6 +273,14 @@ export default {
|
||||||
'"]',
|
'"]',
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
async fetchPlaylist() {
|
||||||
|
return await await this.fetchJson(this.apiUrl() + "/playlists/" + this.$route.query.list);
|
||||||
|
},
|
||||||
|
async getPlaylistData() {
|
||||||
|
this.fetchPlaylist()
|
||||||
|
.then(data => (this.playlist = data))
|
||||||
|
.then(() => (document.title = this.playlist.name + " - Piped"));
|
||||||
|
},
|
||||||
fetchComments() {
|
fetchComments() {
|
||||||
return this.fetchJson(this.apiUrl() + "/comments/" + this.getVideoId());
|
return this.fetchJson(this.apiUrl() + "/comments/" + this.getVideoId());
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue