mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-24 14:33:35 +00:00
use regex
This commit is contained in:
parent
6c3eb2304d
commit
c92eb10a86
@ -62,9 +62,10 @@ export default {
|
||||
getRssUrl: _this => {
|
||||
return _this.authApiUrl() + "/rss/playlists/" + _this.$route.query.list;
|
||||
},
|
||||
isPipedPlaylist() {
|
||||
// FIXME: this checks whether it's a YouTube or a Piped playlist
|
||||
return this.$route.query.list.includes("-");
|
||||
isPipedPlaylist: _this => {
|
||||
// regex to determine whether it's a Piped plalylist
|
||||
const regex = new RegExp("[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}");
|
||||
return regex.test(_this.$route.query.list);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
@ -117,14 +118,13 @@ export default {
|
||||
this.playlist.relatedStreams.splice(index, 1);
|
||||
},
|
||||
async clonePlaylist() {
|
||||
const playlistId = this.$route.query.list;
|
||||
this.fetchJson(this.authApiUrl() + "/import/playlist", null, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: this.getAuthToken(),
|
||||
},
|
||||
body: JSON.stringify({
|
||||
playlistId: playlistId,
|
||||
playlistId: this.$route.query.list,
|
||||
}),
|
||||
}).then(resp => {
|
||||
if (!resp.error) {
|
||||
|
Loading…
Reference in New Issue
Block a user