From 866611fdad59bcd12c182400986ab06afa31b12a Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Thu, 12 Sep 2024 00:36:55 -0400 Subject: [PATCH] Update files i forgot to include in commit --- .../watch-video-comments/watch-video-comments.js | 2 +- .../watch-video-playlist/watch-video-playlist.js | 8 ++++---- src/renderer/helpers/channels.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/renderer/components/watch-video-comments/watch-video-comments.js b/src/renderer/components/watch-video-comments/watch-video-comments.js index 5ce0843a02fb9..4cc8601414a12 100644 --- a/src/renderer/components/watch-video-comments/watch-video-comments.js +++ b/src/renderer/components/watch-video-comments/watch-video-comments.js @@ -355,7 +355,7 @@ export default defineComponent({ showToast(`${errorMessage}: ${err}`, 10000, () => { copyToClipboard(err) }) - if (process.env.SUPPORTS_LOCAL_API && this.backendFallback && this.backendPreference === 'invidious') { + if (process.env.SUPPORTS_LOCAL_API && this.backendFallback && this.backendPreference === API_DATA_SOURCES.INVIDIOUS_API) { showToast(this.$t('Falling back to Local API')) this.getCommentDataLocal() } else { diff --git a/src/renderer/components/watch-video-playlist/watch-video-playlist.js b/src/renderer/components/watch-video-playlist/watch-video-playlist.js index c2902a49bb3a0..acf9128be3e06 100644 --- a/src/renderer/components/watch-video-playlist/watch-video-playlist.js +++ b/src/renderer/components/watch-video-playlist/watch-video-playlist.js @@ -198,7 +198,7 @@ export default defineComponent({ }, playlistId: function (newVal, oldVal) { if (oldVal !== newVal) { - if (!process.env.SUPPORTS_LOCAL_API || this.backendPreference === 'invidious') { + if (!process.env.SUPPORTS_LOCAL_API || this.backendPreference === API_DATA_SOURCES.INVIDIOUS_API) { this.getPlaylistInformationInvidious() } else { this.getPlaylistInformationLocal() @@ -254,7 +254,7 @@ export default defineComponent({ if (this.selectedUserPlaylist != null) { this.parseUserPlaylist(this.selectedUserPlaylist) - } else if (!process.env.SUPPORTS_LOCAL_API || this.backendPreference === 'invidious') { + } else if (!process.env.SUPPORTS_LOCAL_API || this.backendPreference === API_DATA_SOURCES.INVIDIOUS_API) { this.getPlaylistInformationInvidious() } else { this.getPlaylistInformationLocal() @@ -406,7 +406,7 @@ export default defineComponent({ this.channelName = cachedPlaylist.channelName this.channelId = cachedPlaylist.channelId - if (!process.env.SUPPORTS_LOCAL_API || this.backendPreference === 'invidious' || cachedPlaylist.continuationData === null) { + if (!process.env.SUPPORTS_LOCAL_API || this.backendPreference === API_DATA_SOURCES.INVIDIOUS_API || cachedPlaylist.continuationData === null) { this.playlistItems = cachedPlaylist.items } else { const videos = cachedPlaylist.items @@ -482,7 +482,7 @@ export default defineComponent({ showToast(`${errorMessage}: ${err}`, 10000, () => { copyToClipboard(err) }) - if (process.env.SUPPORTS_LOCAL_API && this.backendPreference === 'invidious' && this.backendFallback) { + if (process.env.SUPPORTS_LOCAL_API && this.backendPreference === API_DATA_SOURCES.INVIDIOUS_API && this.backendFallback) { showToast(this.$t('Falling back to Local API')) this.getPlaylistInformationLocal() } else { diff --git a/src/renderer/helpers/channels.js b/src/renderer/helpers/channels.js index c9f2ccaf450e6..d93d3bab06e7b 100644 --- a/src/renderer/helpers/channels.js +++ b/src/renderer/helpers/channels.js @@ -12,7 +12,7 @@ import { getLocalChannel, parseLocalChannelHeader } from './api/local' */ async function findChannelById(id, backendOptions) { try { - if (!process.env.SUPPORTS_LOCAL_API || backendOptions.preference === 'invidious') { + if (!process.env.SUPPORTS_LOCAL_API || backendOptions.preference === API_DATA_SOURCES.INVIDIOUS_API) { return await invidiousGetChannelInfo(id) } else { return await getLocalChannel(id) @@ -23,7 +23,7 @@ async function findChannelById(id, backendOptions) { return { invalid: true } } if (process.env.SUPPORTS_LOCAL_API && backendOptions.fallback) { - if (backendOptions.preference === 'invidious') { + if (backendOptions.preference === API_DATA_SOURCES.INVIDIOUS_API) { return await getLocalChannel(id) } if (backendOptions.preference === API_DATA_SOURCES.LOCAL_API) { @@ -47,7 +47,7 @@ export async function findChannelTagInfo(id, backendOptions) { if (!checkYoutubeChannelId(id)) return { invalidId: true } try { const channel = await findChannelById(id, backendOptions) - if (!process.env.SUPPORTS_LOCAL_API || backendOptions.preference === 'invidious') { + if (!process.env.SUPPORTS_LOCAL_API || backendOptions.preference === API_DATA_SOURCES.INVIDIOUS_API) { if (channel.invalid) return { invalidId: true } return { preferredName: channel.author,