Fix formatting.

This commit is contained in:
Kavin 2022-11-11 21:28:34 +00:00
parent 599540f5a0
commit 47bf276f7a
No known key found for this signature in database
GPG Key ID: 49451E4482CC5BCD

View File

@ -46,11 +46,11 @@
</template> </template>
<script> <script>
import ErrorHandler from "./ErrorHandler.vue"; import ErrorHandler from "./ErrorHandler.vue";
import VideoItem from "./VideoItem.vue"; import VideoItem from "./VideoItem.vue";
import WatchOnYouTubeButton from "./WatchOnYouTubeButton.vue"; import WatchOnYouTubeButton from "./WatchOnYouTubeButton.vue";
export default { export default {
components: { components: {
ErrorHandler, ErrorHandler,
VideoItem, VideoItem,
@ -63,10 +63,10 @@
}; };
}, },
computed: { computed: {
getRssUrl: (_this) => { getRssUrl: _this => {
return _this.authApiUrl() + "/rss/playlists/" + _this.$route.query.list; return _this.authApiUrl() + "/rss/playlists/" + _this.$route.query.list;
}, },
isPipedPlaylist: (_this) => { isPipedPlaylist: _this => {
// regex to determine whether it's a Piped plalylist // 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( 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, _this.$route.query.list,
@ -81,9 +81,9 @@
headers: { headers: {
Authorization: this.getAuthToken(), Authorization: this.getAuthToken(),
}, },
}).then((json) => { }).then(json => {
if (json.error) alert(json.error); if (json.error) alert(json.error);
else if (json.filter((playlist) => playlist.id === playlistId).length > 0) this.admin = true; else if (json.filter(playlist => playlist.id === playlistId).length > 0) this.admin = true;
}); });
}, },
activated() { activated() {
@ -99,7 +99,7 @@
}, },
async getPlaylistData() { async getPlaylistData() {
this.fetchPlaylist() this.fetchPlaylist()
.then((data) => (this.playlist = data)) .then(data => (this.playlist = data))
.then(() => this.updateTitle()); .then(() => this.updateTitle());
}, },
async updateTitle() { async updateTitle() {
@ -111,11 +111,11 @@
this.loading = true; this.loading = true;
this.fetchJson(this.authApiUrl() + "/nextpage/playlists/" + this.$route.query.list, { this.fetchJson(this.authApiUrl() + "/nextpage/playlists/" + this.$route.query.list, {
nextpage: this.playlist.nextpage, nextpage: this.playlist.nextpage,
}).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.loading = false; this.loading = false;
json.relatedStreams.map((stream) => this.playlist.relatedStreams.push(stream)); json.relatedStreams.map(stream => this.playlist.relatedStreams.push(stream));
}); });
} }
}, },
@ -131,7 +131,7 @@
body: JSON.stringify({ body: JSON.stringify({
playlistId: this.$route.query.list, playlistId: this.$route.query.list,
}), }),
}).then((resp) => { }).then(resp => {
if (!resp.error) { if (!resp.error) {
alert(this.$t("actions.clone_playlist_success")); alert(this.$t("actions.clone_playlist_success"));
} else alert(resp.error); } else alert(resp.error);
@ -139,11 +139,11 @@
}, },
downloadPlaylistAsTxt() { downloadPlaylistAsTxt() {
var data = ""; var data = "";
this.playlist.relatedStreams.forEach((element) => { this.playlist.relatedStreams.forEach(element => {
data += "https://piped.video" + element.url + "\n"; data += "https://piped.video" + element.url + "\n";
}); });
this.download(data, this.playlist.name + ".txt", "text/plain"); this.download(data, this.playlist.name + ".txt", "text/plain");
}, },
}, },
}; };
</script> </script>