Skip to content

Commit

Permalink
Update files i forgot to include in commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer committed Sep 12, 2024
1 parent 4fb28c2 commit 866611f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/helpers/channels.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit 866611f

Please sign in to comment.