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 5ce0843a02fb..4cc8601414a1 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 c2902a49bb3a..acf9128be3e0 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 c9f2ccaf450e..d93d3bab06e7 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,