Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using piped api for comments, playlists, search suggestions and trending #3559

Draft
wants to merge 137 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
5d903ed
Allow using piped for comments
ChunkyProgrammer May 4, 2023
beb3e55
add piped playlist support
ChunkyProgrammer May 8, 2023
1ffcc55
add piped settings + fallback when not supported
ChunkyProgrammer May 9, 2023
98fdaa3
fix comment and playlist fallbacks
ChunkyProgrammer May 9, 2023
7550f59
prevent same api from being used for backend + fallback
ChunkyProgrammer May 9, 2023
379b593
fix displaying playlist thumbnails
ChunkyProgrammer May 9, 2023
b232567
Revert "fix displaying playlist thumbnails"
ChunkyProgrammer May 9, 2023
34f483c
format piped instances json
ChunkyProgrammer May 9, 2023
7e5bb17
fix piped to yt image conversion, hide missing playlist data
ChunkyProgrammer May 9, 2023
5491ef6
create ft-instance-selector component
ChunkyProgrammer May 10, 2023
34a1706
hide dash on playlist info for piped
ChunkyProgrammer May 10, 2023
44e82ac
Fix Invidious fallback for piped playlists
ChunkyProgrammer May 11, 2023
c5244b0
Fix incorrect toast message
ChunkyProgrammer May 11, 2023
b883d83
simplify v-if
ChunkyProgrammer May 11, 2023
5ef7627
Allow using piped for comments
ChunkyProgrammer May 4, 2023
17c7510
add piped playlist support
ChunkyProgrammer May 8, 2023
3633a86
add piped settings + fallback when not supported
ChunkyProgrammer May 9, 2023
3b4ee59
fix comment and playlist fallbacks
ChunkyProgrammer May 9, 2023
d5f9517
prevent same api from being used for backend + fallback
ChunkyProgrammer May 9, 2023
92a3bbd
fix displaying playlist thumbnails
ChunkyProgrammer May 9, 2023
315e96b
Revert "fix displaying playlist thumbnails"
ChunkyProgrammer May 9, 2023
a581bd0
format piped instances json
ChunkyProgrammer May 9, 2023
632a7c8
fix piped to yt image conversion, hide missing playlist data
ChunkyProgrammer May 9, 2023
f109da2
create ft-instance-selector component
ChunkyProgrammer May 10, 2023
31704e0
hide dash on playlist info for piped
ChunkyProgrammer May 10, 2023
0801c07
Fix Invidious fallback for piped playlists
ChunkyProgrammer May 11, 2023
13d3acc
Fix incorrect toast message
ChunkyProgrammer May 11, 2023
48601a6
simplify v-if
ChunkyProgrammer May 11, 2023
add031b
fix clear default instance, fix toast message
ChunkyProgrammer May 16, 2023
5f92e07
Merge branch 'piped-support' of https://github.com/ChunkyProgrammer/F…
ChunkyProgrammer May 16, 2023
f69416c
Merge branch 'development' into piped-support
ChunkyProgrammer May 20, 2023
3300118
add piped to get instances script
ChunkyProgrammer May 20, 2023
3cafb80
Merge branch 'development' into piped-support
ChunkyProgrammer May 22, 2023
eb1bf9c
fix tooltip
ChunkyProgrammer May 22, 2023
f58490a
add error checking before parsing
ChunkyProgrammer May 22, 2023
66578d2
Merge branch 'development' into piped-support
ChunkyProgrammer May 31, 2023
0614bfa
add piped description, use piped for playlist thumbnail
ChunkyProgrammer May 31, 2023
59dfdb2
fix issue when nextpage is null/undefined
ChunkyProgrammer May 31, 2023
e759679
Merge branch 'development' into piped-support
ChunkyProgrammer Jun 20, 2023
0e88d70
Merge branch 'development' into piped-support
ChunkyProgrammer Jun 26, 2023
7370f68
Merge branch 'development' into piped-support
ChunkyProgrammer Jul 2, 2023
36105af
Merge branch 'development' into piped-support
ChunkyProgrammer Jul 4, 2023
d9e208c
Merge branch 'development' into piped-support
ChunkyProgrammer Jul 26, 2023
d530d71
update subscription tabs to work when piped is primary api
ChunkyProgrammer Jul 26, 2023
863c1d2
Merge branch 'development' into piped-support
ChunkyProgrammer Aug 21, 2023
aa7f21c
update isNullOrEmpty imports
ChunkyProgrammer Aug 21, 2023
6647e83
fix getInstances.js
ChunkyProgrammer Aug 21, 2023
22be652
check apiUsed when fetching more comments
ChunkyProgrammer Aug 21, 2023
550a9ab
fix playlist fallback for piped
ChunkyProgrammer Aug 21, 2023
a757a44
fix loading cached playlist
ChunkyProgrammer Aug 21, 2023
04eb9c6
Merge branch 'development' into piped-support
ChunkyProgrammer Aug 26, 2023
533c9da
Merge branch 'development' into piped-support
ChunkyProgrammer Aug 30, 2023
2c50ca4
Merge branch 'development' into piped-support
ChunkyProgrammer Oct 24, 2023
a8998b9
Add Piped support for trending page
ChunkyProgrammer Oct 24, 2023
bb6f321
fix small parsing issues, updated static instance list
ChunkyProgrammer Oct 25, 2023
fe4032b
Merge branch 'development' into piped-support
ChunkyProgrammer Oct 31, 2023
ab6bcc0
Merge branch 'development' into piped-support
ChunkyProgrammer Oct 31, 2023
f9b791e
use fetchWithTimeout for piped instances
ChunkyProgrammer Oct 31, 2023
2151c1c
Comments: populate isOwner field, add authorId
ChunkyProgrammer Oct 31, 2023
2ae441d
Merge branch 'development' into piped-support
ChunkyProgrammer Nov 1, 2023
b509ada
Merge branch 'development' into piped-support
ChunkyProgrammer Nov 6, 2023
d4b2ac9
Merge branch 'development' into piped-support
ChunkyProgrammer Nov 26, 2023
784f495
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 4, 2023
25846f8
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 18, 2023
dd18e51
updated pipe instances
ChunkyProgrammer Dec 18, 2023
99dac6d
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 27, 2023
915a30d
Merge branch 'development' into piped-support
ChunkyProgrammer Jan 2, 2024
e445500
Merge branch 'development' into piped-support and fix errors
ChunkyProgrammer Jan 4, 2024
44c5d2a
fix error where videos in previous playlist appear
ChunkyProgrammer Jan 11, 2024
4fa1d23
Merge branch 'development' into piped-support
ChunkyProgrammer Jan 11, 2024
1b17f6b
Merge branch 'development' into piped-support
ChunkyProgrammer Jan 18, 2024
2b2d677
Merge branch 'development' into piped-support
ChunkyProgrammer Feb 7, 2024
86ef3b1
Merge branch 'development' into piped-support
ChunkyProgrammer Feb 13, 2024
a749d18
update static piped instances
ChunkyProgrammer Feb 13, 2024
461b0f6
Merge branch 'development' into piped-support
ChunkyProgrammer Feb 19, 2024
6fc7cb0
Merge branch 'development' into piped-support
ChunkyProgrammer Mar 8, 2024
40cc1d4
Merge branch 'development' into piped-support
ChunkyProgrammer Mar 13, 2024
9c8df73
Merge branch 'development' into piped-support
ChunkyProgrammer Mar 25, 2024
8c75d8f
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 2, 2024
f6ba3c9
update components that are missing updates
ChunkyProgrammer Apr 2, 2024
469f928
update piped instances
ChunkyProgrammer Apr 2, 2024
53ceba0
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 4, 2024
ca588c7
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 12, 2024
58d3d7e
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 12, 2024
8883f8a
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 16, 2024
e1f040a
add index to videoId for playlist video list
ChunkyProgrammer Apr 16, 2024
0db77be
Hide playlist view count for piped
ChunkyProgrammer Apr 16, 2024
f0733a7
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 17, 2024
742a390
Make suggested changes
ChunkyProgrammer Apr 18, 2024
ff715e9
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 18, 2024
147600b
update piped instance list
ChunkyProgrammer Apr 18, 2024
e427b81
fix lint error
ChunkyProgrammer Apr 18, 2024
4938335
update warn message
ChunkyProgrammer Apr 19, 2024
aaefcd1
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 19, 2024
f867869
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 29, 2024
7caad80
add missing icon to fallback api select
ChunkyProgrammer Apr 29, 2024
36287d2
Merge branch 'development' into piped-support
ChunkyProgrammer Apr 30, 2024
ca5e793
update piped instance list
ChunkyProgrammer Apr 30, 2024
25f14cd
Merge branch 'development' into piped-support
ChunkyProgrammer May 9, 2024
3e963de
Merge branch 'development' into piped-support
ChunkyProgrammer May 18, 2024
15088c2
Merge branch 'development' into piped-support
ChunkyProgrammer May 30, 2024
ccc2531
Merge branch 'development' into piped-support
ChunkyProgrammer May 30, 2024
3d161c0
Merge branch 'development' into piped-support
ChunkyProgrammer May 30, 2024
757e376
fix comment replies
ChunkyProgrammer May 31, 2024
9a07403
merge latest changes into branch
ChunkyProgrammer Jun 12, 2024
010aae9
merge latest changes into branch
ChunkyProgrammer Jul 9, 2024
a78007d
Merge branch 'development' into piped-support
ChunkyProgrammer Aug 12, 2024
6d5bcd7
Allow using Piped for search suggestions
ChunkyProgrammer Aug 12, 2024
548fdce
Merge branch 'development' into piped-support
ChunkyProgrammer Aug 21, 2024
9a63a3e
Merge in latest development changes
ChunkyProgrammer Aug 23, 2024
87e2b4c
Merge branch 'development' into piped-support
ChunkyProgrammer Aug 29, 2024
0edcf7b
Merge latest changes into branch
ChunkyProgrammer Sep 2, 2024
06c6f6f
Update piped instance list
ChunkyProgrammer Sep 2, 2024
b06aa87
=Bring in latest changes
ChunkyProgrammer Sep 5, 2024
219801c
=Use SUPPORTS_LOCAL_API instead of IS_ELECTRON
ChunkyProgrammer Sep 5, 2024
e839f33
Merge branch 'development' into piped-support
ChunkyProgrammer Sep 9, 2024
834e5de
Merge development into piped support
ChunkyProgrammer Sep 12, 2024
12d369f
Merge branch 'development' into piped-support
ChunkyProgrammer Oct 1, 2024
65a87d4
Merge branch 'development' into piped-support
ChunkyProgrammer Oct 8, 2024
164a443
Merge in latest changes from dev
ChunkyProgrammer Oct 16, 2024
04a9491
Merge latest changes from development
ChunkyProgrammer Oct 28, 2024
56092e3
Update backend Preference logic for community post to fallback when P…
ChunkyProgrammer Oct 28, 2024
e114206
Merge branch 'development' into piped-support
ChunkyProgrammer Nov 4, 2024
fa4eb5f
Switch piped comments to calculatePublishedDate and getRelativeTimeFr…
ChunkyProgrammer Nov 4, 2024
938eb80
Don't specify what's missing from piped since it will be added shortl…
ChunkyProgrammer Nov 4, 2024
53e03c5
Update piped-instances.json
ChunkyProgrammer Nov 5, 2024
2dd1bba
switch ft-instance-selector to composition api
ChunkyProgrammer Nov 5, 2024
204b42a
add jsdoc comments to piped.js
ChunkyProgrammer Nov 5, 2024
5f6f0e0
Merge latest changes
ChunkyProgrammer Nov 21, 2024
541ac99
Merge latest changes
ChunkyProgrammer Nov 21, 2024
b330851
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 2, 2024
d642b2f
Update Piped comments code
ChunkyProgrammer Dec 2, 2024
80d2a72
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 3, 2024
9baf049
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 7, 2024
7f4aa20
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 9, 2024
f4503f2
fix sidenav
ChunkyProgrammer Dec 9, 2024
b212996
Merge branch 'development' into piped-support
ChunkyProgrammer Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions _scripts/getInstances.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ fetch(invidiousApiUrl).then(e => e.json()).then(res => {
})
fs.writeFile('././static/invidious-instances.json', JSON.stringify(data, null, 2))
})

const pipedApiUrl = 'https://piped-instances.kavin.rocks/'

fetch(pipedApiUrl).then(e => e.json()).then(res => {
const data = res.map(e => e.api_url)
fs.writeFile('././static/piped-instances.json', JSON.stringify(data, null, 2))
})
17 changes: 15 additions & 2 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export default defineComponent({
defaultInvidiousInstance: function () {
return this.$store.getters.getDefaultInvidiousInstance
},
defaultPipedInstance: function () {
return this.$store.getters.getDefaultPipedInstance
},

baseTheme: function () {
return this.$store.getters.getBaseTheme
Expand Down Expand Up @@ -159,9 +162,17 @@ export default defineComponent({
this.grabUserSettings().then(async () => {
this.checkThemeSettings()

await this.fetchInvidiousInstances()
await Promise.allSettled([
this.fetchInvidiousInstances(),
this.fetchPipedInstances()
])

if (this.defaultInvidiousInstance === '') {
await this.setRandomCurrentInvidiousInstance()
this.setRandomCurrentInvidiousInstance()
}

if (this.defaultPipedInstance === '') {
this.setRandomCurrentPipedInstance()
}

this.grabAllProfiles(this.$t('Profile.All Channels')).then(async () => {
Expand Down Expand Up @@ -542,6 +553,8 @@ export default defineComponent({
'getExternalPlayerCmdArgumentsData',
'fetchInvidiousInstances',
'setRandomCurrentInvidiousInstance',
'fetchPipedInstances',
'setRandomCurrentPipedInstance',
'setupListenersToSyncWindows',
'updateBaseTheme',
'updateMainColor',
Expand Down
8 changes: 6 additions & 2 deletions src/renderer/components/data-settings/data-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ export default defineComponent({
},
computed: {
backendPreference: function () {
return this.$store.getters.getBackendPreference
let preference = this.$store.getters.getBackendPreference
if (preference === 'piped') {
preference = this.$store.getters.getFallbackPreference
}
return preference
},
backendFallback: function () {
return this.$store.getters.getBackendFallback
return this.$store.getters.getBackendFallback && this.$store.getters.getBackendPreference !== 'piped'
},
profileList: function () {
return this.$store.getters.getProfileList
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { defineComponent } from 'vue'
import FtFlexBox from '../ft-flex-box/ft-flex-box.vue'
import FtInput from '../ft-input/ft-input.vue'
import FtButton from '../ft-button/ft-button.vue'

export default defineComponent({
name: 'FtInstanceSelector',
components: {
'ft-button': FtButton,
'ft-flex-box': FtFlexBox,
'ft-input': FtInput
},
props: {
placeholder: {
type: String,
required: true
},
tooltip: {
type: String,
required: true
},
backendType: {
type: String,
required: true
},
currentInstance: {
type: String,
required: true
},
instanceList: {
type: Array,
required: true
},
defaultInstance: {
type: String,
required: true
}
},
methods: {
handleInstanceInput: function (inputData) {
this.$emit('input', inputData)
},
setDefaultInstance: function () {
this.$emit('setDefaultInstance')
},
clearDefaultInstance: function () {
this.$emit('clearDefaultInstance')
}
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<template>
<div>
<ft-flex-box
class="settingsFlexStart460px"
>
<ft-input
:placeholder="placeholder"
:show-action-button="false"
:show-label="true"
:value="currentInstance"
:data-list="instanceList"
:tooltip="tooltip"
@input="handleInstanceInput"
/>
</ft-flex-box>
<ft-flex-box>
<div v-if="backendType === 'piped'">
<a href="https://github.com/TeamPiped/Piped/wiki/Instances">
{{ $t('Settings.General Settings.View all Piped instance information') }}
</a>
</div>
<div
v-else
ChunkyProgrammer marked this conversation as resolved.
Show resolved Hide resolved
>
<a
href="https://api.invidious.io"
>
{{ $t('Settings.General Settings.View all Invidious instance information') }}
</a>
</div>
</ft-flex-box>
<p
v-if="defaultInstance !== ''"
class="center"
>
{{ $t('Settings.General Settings.The currently set default instance is {instance}', {
instance: defaultInstance
}) }}
</p>
<template v-else>
<p
class="center"
>
{{ $t('Settings.General Settings.No default instance has been set') }}
</p>
<p
class="center"
>
{{ $t('Settings.General Settings.Current instance will be randomized on startup') }}
</p>
</template>
<ft-flex-box>
<ft-button
:label="$t('Settings.General Settings.Set Current Instance as Default')"
@click="setDefaultInstance"
/>
<ft-button
:label="$t('Settings.General Settings.Clear Default Instance')"
@click="clearDefaultInstance"
/>
</ft-flex-box>
</div>
</template>

<script src="./ft-instance-selector"></script>
33 changes: 25 additions & 8 deletions src/renderer/components/ft-list-video/ft-list-video.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ export default defineComponent({
return this.$store.getters.getBackendPreference
},

fallbackPreference: function () {
return this.$store.getters.getFallbackPreference
},

currentInvidiousInstance: function () {
return this.$store.getters.getCurrentInvidiousInstance
},
Expand Down Expand Up @@ -313,27 +317,40 @@ export default defineComponent({
return require('../../assets/img/thumbnail_placeholder.svg')
}

if (this.useDeArrowThumbnails && this.deArrowCache?.thumbnail != null) {
ChunkyProgrammer marked this conversation as resolved.
Show resolved Hide resolved
return this.deArrowCache.thumbnail
let baseUrl = ''
let backendPreference = this.backendPreference
if (backendPreference === 'piped') {
if (this.data.thumbnail) {
return this.data.thumbnail
} else {
// this should be removed once piped supports more endpoints
backendPreference = this.fallbackPreference
}
}

let baseUrl
if (this.backendPreference === 'invidious') {
if (!process.env.IS_ELECTRON || backendPreference === 'invidious') {
baseUrl = this.currentInvidiousInstance
} else {
baseUrl = 'https://i.ytimg.com'
}

let imageUrl = ''

switch (this.thumbnailPreference) {
case 'start':
return `${baseUrl}/vi/${this.id}/mq1.jpg`
imageUrl = `${baseUrl}/vi/${this.id}/mq1.jpg`
break
case 'middle':
return `${baseUrl}/vi/${this.id}/mq2.jpg`
imageUrl = `${baseUrl}/vi/${this.id}/mq2.jpg`
break
case 'end':
return `${baseUrl}/vi/${this.id}/mq3.jpg`
imageUrl = `${baseUrl}/vi/${this.id}/mq3.jpg`
break
default:
return `${baseUrl}/vi/${this.id}/mqdefault.jpg`
imageUrl = `${baseUrl}/vi/${this.id}/mqdefault.jpg`
}

return imageUrl
},

hideVideoViews: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export default defineComponent({
},
computed: {
backendPreference: function () {
return this.$store.getters.getBackendPreference
let preference = this.$store.getters.getBackendPreference
if (preference === 'piped') {
preference = this.$store.getters.getFallbackPreference
}
return preference
},
currentInvidiousInstance: function () {
return this.$store.getters.getCurrentInvidiousInstance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export default defineComponent({
},
computed: {
backendPreference: function () {
return this.$store.getters.getBackendPreference
let preference = this.$store.getters.getBackendPreference
if (preference === 'piped') {
preference = this.$store.getters.getFallbackPreference
}
return preference
},
currentInvidiousInstance: function () {
return this.$store.getters.getCurrentInvidiousInstance
Expand Down
Loading
Loading