Replace piped.kavin.rocks with piped.video.

This commit is contained in:
Kavin 2022-11-11 21:19:26 +00:00 committed by GitHub
parent e2bcb8aecc
commit 599540f5a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 143 additions and 143 deletions

View File

@ -22,7 +22,7 @@ body:
label: Official Instance label: Official Instance
description: Can the bug be reproduced on the official instance? description: Can the bug be reproduced on the official instance?
options: options:
- label: The bug is reproducable on the [official hosted instance](http://piped.kavin.rocks/) or is API related. - label: The bug is reproducable on the [official hosted instance](http://piped.video/) or is API related.
- type: textarea - type: textarea
attributes: attributes:

View File

@ -2,7 +2,7 @@
[![AGPL v3](https://shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.en.html) [![AGPL v3](https://shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.en.html)
[![Matrix](https://img.shields.io/matrix/piped:matrix.org)](https://matrix.to/#/#piped:matrix.org) [![Matrix](https://img.shields.io/matrix/piped:matrix.org)](https://matrix.to/#/#piped:matrix.org)
[![Registered Users](https://pipedapi.kavin.rocks/registered/badge)](https://piped.kavin.rocks/register) [![Registered Users](https://pipedapi.kavin.rocks/registered/badge)](https://piped.video/register)
[![IPFS Build](https://github.com/TeamPiped/Piped/actions/workflows/ipfs-build.yml/badge.svg)](https://piped-ipfs.kavin.rocks/) [![IPFS Build](https://github.com/TeamPiped/Piped/actions/workflows/ipfs-build.yml/badge.svg)](https://piped-ipfs.kavin.rocks/)
[![GitHub Repo stars](https://img.shields.io/github/stars/TeamPiped/Piped-Frontend?style=social)](https://github.com/TeamPiped/Piped/stargazers) [![GitHub Repo stars](https://img.shields.io/github/stars/TeamPiped/Piped-Frontend?style=social)](https://github.com/TeamPiped/Piped/stargazers)
[![GitHub last commit](https://img.shields.io/github/last-commit/TeamPiped/Piped-Frontend)](https://github.com/TeamPiped/Piped/commits) [![GitHub last commit](https://img.shields.io/github/last-commit/TeamPiped/Piped-Frontend)](https://github.com/TeamPiped/Piped/commits)

View File

@ -4,7 +4,7 @@
<LongName>Piped Search</LongName> <LongName>Piped Search</LongName>
<Description>Search for videos, channels, and playlists on Piped</Description> <Description>Search for videos, channels, and playlists on Piped</Description>
<InputEncoding>UTF-8</InputEncoding> <InputEncoding>UTF-8</InputEncoding>
<Image width="48" height="48" type="image/x-icon">https://piped.kavin.rocks/favicon.ico</Image> <Image width="48" height="48" type="image/x-icon">https://piped.video/favicon.ico</Image>
<Url method="get" rel="results" type="text/html" template="https://piped.kavin.rocks/results?search_query={searchTerms}" /> <Url method="get" rel="results" type="text/html" template="https://piped.video/results?search_query={searchTerms}" />
<Url method="get" rel="suggestions" type="application/x-suggestions+json" template="https://pipedapi.kavin.rocks/opensearch/suggestions?query={searchTerms}" /> <Url method="get" rel="suggestions" type="application/x-suggestions+json" template="https://pipedapi.kavin.rocks/opensearch/suggestions?query={searchTerms}" />
</OpenSearchDescription> </OpenSearchDescription>

View File

@ -1,149 +1,149 @@
<template> <template>
<ErrorHandler v-if="playlist && playlist.error" :message="playlist.message" :error="playlist.error" /> <ErrorHandler v-if="playlist && playlist.error" :message="playlist.message" :error="playlist.error" />
<div v-if="playlist" v-show="!playlist.error"> <div v-if="playlist" v-show="!playlist.error">
<h1 class="text-center my-4" v-text="playlist.name" /> <h1 class="text-center my-4" v-text="playlist.name" />
<div class="flex justify-between items-center"> <div class="flex justify-between items-center">
<div> <div>
<router-link class="link" :to="playlist.uploaderUrl || '/'"> <router-link class="link" :to="playlist.uploaderUrl || '/'">
<img :src="playlist.uploaderAvatar" loading="lazy" class="rounded-full" /> <img :src="playlist.uploaderAvatar" loading="lazy" class="rounded-full" />
<strong v-text="playlist.uploader" /> <strong v-text="playlist.uploader" />
</router-link> </router-link>
</div> </div>
<div> <div>
<strong v-text="`${playlist.videos} ${$t('video.videos')}`" /> <strong v-text="`${playlist.videos} ${$t('video.videos')}`" />
<br /> <br />
<button class="btn mr-1" v-if="authenticated && !isPipedPlaylist" @click="clonePlaylist"> <button class="btn mr-1" v-if="authenticated && !isPipedPlaylist" @click="clonePlaylist">
{{ $t("actions.clone_playlist") }}<font-awesome-icon class="ml-3" icon="clone" /> {{ $t("actions.clone_playlist") }}<font-awesome-icon class="ml-3" icon="clone" />
</button> </button>
<button class="btn mr-1" @click="downloadPlaylistAsTxt"> <button class="btn mr-1" @click="downloadPlaylistAsTxt">
{{ $t("actions.download_as_txt") }} {{ $t("actions.download_as_txt") }}
</button> </button>
<a class="btn mr-1" :href="getRssUrl"> <a class="btn mr-1" :href="getRssUrl">
<font-awesome-icon icon="rss" /> <font-awesome-icon icon="rss" />
</a> </a>
<WatchOnYouTubeButton :link="`https://www.youtube.com/playlist?list=${this.$route.query.list}`" /> <WatchOnYouTubeButton :link="`https://www.youtube.com/playlist?list=${this.$route.query.list}`" />
</div> </div>
</div> </div>
<hr /> <hr />
<div class="video-grid"> <div class="video-grid">
<VideoItem <VideoItem
v-for="(video, index) in playlist.relatedStreams" v-for="(video, index) in playlist.relatedStreams"
:key="video.url" :key="video.url"
:item="video" :item="video"
:index="index" :index="index"
:playlist-id="$route.query.list" :playlist-id="$route.query.list"
:admin="admin" :admin="admin"
@remove="removeVideo(index)" @remove="removeVideo(index)"
height="94" height="94"
width="168" width="168"
/> />
</div> </div>
</div> </div>
</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,
WatchOnYouTubeButton, WatchOnYouTubeButton,
}, },
data() { data() {
return { return {
playlist: null, playlist: null,
admin: false, admin: false,
}; };
}, },
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,
); );
}, },
}, },
mounted() { mounted() {
this.getPlaylistData(); this.getPlaylistData();
const playlistId = this.$route.query.list; const playlistId = this.$route.query.list;
if (this.authenticated && playlistId?.length == 36) if (this.authenticated && playlistId?.length == 36)
this.fetchJson(this.authApiUrl() + "/user/playlists", null, { this.fetchJson(this.authApiUrl() + "/user/playlists", null, {
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() {
window.addEventListener("scroll", this.handleScroll); window.addEventListener("scroll", this.handleScroll);
if (this.playlist) this.updateTitle(); if (this.playlist) this.updateTitle();
}, },
deactivated() { deactivated() {
window.removeEventListener("scroll", this.handleScroll); window.removeEventListener("scroll", this.handleScroll);
}, },
methods: { methods: {
async fetchPlaylist() { async fetchPlaylist() {
return await await this.fetchJson(this.authApiUrl() + "/playlists/" + this.$route.query.list); return await await this.fetchJson(this.authApiUrl() + "/playlists/" + this.$route.query.list);
}, },
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() {
document.title = this.playlist.name + " - Piped"; document.title = this.playlist.name + " - Piped";
}, },
handleScroll() { handleScroll() {
if (this.loading || !this.playlist || !this.playlist.nextpage) 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.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));
}); });
} }
}, },
removeVideo(index) { removeVideo(index) {
this.playlist.relatedStreams.splice(index, 1); this.playlist.relatedStreams.splice(index, 1);
}, },
async clonePlaylist() { async clonePlaylist() {
this.fetchJson(this.authApiUrl() + "/import/playlist", null, { this.fetchJson(this.authApiUrl() + "/import/playlist", null, {
method: "POST", method: "POST",
headers: { headers: {
Authorization: this.getAuthToken(), Authorization: this.getAuthToken(),
}, },
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);
}); });
}, },
downloadPlaylistAsTxt() { downloadPlaylistAsTxt() {
var data = ""; var data = "";
this.playlist.relatedStreams.forEach(element => { this.playlist.relatedStreams.forEach((element) => {
data += "https://piped.kavin.rocks" + 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>