From 69e6118dc5eceb366000afb2cbb8234296f0e4fd Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Wed, 24 Feb 2021 15:05:41 +0530 Subject: [PATCH] Commit everything. --- public/index.html | 1 + public/opensearch.xml | 9 ++ src/App.vue | 16 +- src/components/Channel.vue | 45 +++--- src/components/Playlist.vue | 41 +++-- src/components/SearchResults.vue | 38 ++--- src/components/TrendingPage.vue | 16 +- src/components/WatchVideo.vue | 260 ++++++++++--------------------- src/main.js | 6 + src/utils/DashUtils.js | 189 ++++++++++++++++++++++ yarn.lock | 231 +++------------------------ 11 files changed, 394 insertions(+), 458 deletions(-) create mode 100644 public/opensearch.xml create mode 100644 src/utils/DashUtils.js diff --git a/public/index.html b/public/index.html index 41235286..43f6025c 100644 --- a/public/index.html +++ b/public/index.html @@ -5,6 +5,7 @@ + <%= htmlWebpackPlugin.options.title %> diff --git a/public/opensearch.xml b/public/opensearch.xml new file mode 100644 index 00000000..446a794a --- /dev/null +++ b/public/opensearch.xml @@ -0,0 +1,9 @@ + + + Piped + Piped Search + Search for videos, channels, and playlists on Piped + UTF-8 + https://piped.kavin.rocks/favicon.ico + + diff --git a/src/App.vue b/src/App.vue index 9319b996..29af6304 100644 --- a/src/App.vue +++ b/src/App.vue @@ -64,15 +64,11 @@ export default { return; } - fetch( + this.fetchJson( Constants.BASE_URL + "/suggestions?query=" + encodeURI(this.searchText + e.key) - ) - .then(resp => resp.json()) - .then(json => { - this.searchSuggestions = json; - }); + ); } } }; @@ -104,7 +100,7 @@ export default { background-color: #0b0e0f; } -* { - scrollbar-color: #15191a #444a4e; -} - +* { + scrollbar-color: #15191a #444a4e; +} + diff --git a/src/components/Channel.vue b/src/components/Channel.vue index 1c5639b9..631cf1d0 100644 --- a/src/components/Channel.vue +++ b/src/components/Channel.vue @@ -7,6 +7,7 @@ v-if="channel.bannerUrl" v-bind:src="channel.bannerUrl" style="width: 100%" + loading="lazy" />

@@ -22,17 +23,23 @@ class="uk-link-muted uk-text-justify" v-bind:to="item.url || '/'" > - + {{ item.title }}
- {{ timeFormat(item.duration) }} - - {{ item.views }} views +
+ {{ item.uploadedDate }} +
+ + {{ timeFormat(item.duration) }}
@@ -58,13 +65,9 @@ export default { }, methods: { async fetchChannel() { - return await ( - await fetch( - Constants.BASE_URL + - "/channels/" + - this.$route.params.channelId - ) - ).json(); + return await this.fetchJson( + Constants.BASE_URL + "/channels/" + this.$route.params.channelId + ); }, async getChannelData() { this.fetchChannel() @@ -78,22 +81,20 @@ export default { document.body.offsetHeight - window.innerHeight ) { this.loading = true; - fetch( + this.fetchJson( Constants.BASE_URL + "/nextpage/channels/" + this.$route.params.channelId + "?url=" + encodeURIComponent(this.channel.nextpage) - ) - .then(body => body.json()) - .then(json => { - this.channel.relatedStreams.concat(json.relatedStreams); - this.channel.nextpage = json.nextpage; - this.loading = false; - json.relatedStreams.map(stream => - this.channel.relatedStreams.push(stream) - ); - }); + ).then(json => { + this.channel.relatedStreams.concat(json.relatedStreams); + this.channel.nextpage = json.nextpage; + this.loading = false; + json.relatedStreams.map(stream => + this.channel.relatedStreams.push(stream) + ); + }); } } } diff --git a/src/components/Playlist.vue b/src/components/Playlist.vue index d7813eae..574501e3 100644 --- a/src/components/Playlist.vue +++ b/src/components/Playlist.vue @@ -1,7 +1,8 @@