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 @@