diff --git a/src/components/PlaylistPage.vue b/src/components/PlaylistPage.vue index d54d63da..67e5e9a7 100644 --- a/src/components/PlaylistPage.vue +++ b/src/components/PlaylistPage.vue @@ -2,7 +2,7 @@
-

+

@@ -15,7 +15,10 @@ @@ -59,6 +62,12 @@ export default { getRssUrl: _this => { return _this.authApiUrl() + "/rss/playlists/" + _this.$route.query.list; }, + isPipedPlaylist: _this => { + // regex to determine whether it's a Piped plalylist + return /[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}/.test( + _this.$route.query.list, + ); + }, }, mounted() { this.getPlaylistData(); @@ -109,6 +118,21 @@ export default { removeVideo(index) { this.playlist.relatedStreams.splice(index, 1); }, + async clonePlaylist() { + this.fetchJson(this.authApiUrl() + "/import/playlist", null, { + method: "POST", + headers: { + Authorization: this.getAuthToken(), + }, + body: JSON.stringify({ + playlistId: this.$route.query.list, + }), + }).then(resp => { + if (!resp.error) { + alert(this.$t("actions.clone_playlist_success")); + } else alert(resp.error); + }); + }, }, }; diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue index 912f5d02..ee88f268 100644 --- a/src/components/PreferencesPage.vue +++ b/src/components/PreferencesPage.vue @@ -244,7 +244,7 @@ class="input w-auto" type="password" /> - +

diff --git a/src/components/SearchResults.vue b/src/components/SearchResults.vue index 7cc1c08a..0e16f69a 100644 --- a/src/components/SearchResults.vue +++ b/src/components/SearchResults.vue @@ -1,5 +1,5 @@