Skip to content

[Bug]: Featured Channels throw error on click (only while using the Invidious API) #2481

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

Closed
3 of 4 tasks
MarmadileManteater opened this issue Aug 14, 2022 · 2 comments · Fixed by #2483
Closed
3 of 4 tasks
Labels
B: API issue bug Something isn't working

Comments

@MarmadileManteater
Copy link
Contributor

Guidelines

  • I have encountered this bug in the latest release of FreeTube.
  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.
  • I have searched the documentation for information that matches the description of the bug I want to file, without success.

Describe the bug

  1. Select "Invidious API" as the preferred API backend.
  2. Navigate to a channel with featured channels.
  3. Click on one of the featured channel icons.
    featured-channels-error

The page remains the same except that the body changes to contain the text: "Could not get channel info".
I started debugging this issue in my fork (original issue: MarmadileManteater#12) because I thought it was something I introduced, but I found the issue was inside of ./src/renderer/views/Channel/Channel.vue, and I was able to replicate the issue on the newest release.

Expected Behavior

Clicking one of the featured channel icons should change the route to the id of that featured channel.

Issue Labels

API issue

FreeTube Version

v0.17.1

Operating System Version

Windows 10 Pro Version 21H2 Installed on ‎4/‎3/‎2022 OS build 19044.1889 Experience Windows Feature Experience Pack 120.2212.4180.0

Installation Method

.exe

Primary API used

Invidious API

Last Known Working FreeTube Version (If Any)

No response

Additional Information

I believe the issue is that the ft-channel-bubble element expects featured channels to contain the key "channelId".

<!-- line 130 of src/renderer/views/Channel/Channel.vue -->
<ft-channel-bubble
  v-for="(channel, index) in relatedChannels"
  :key="index"
  :channel-name="channel.author || channel.channelName"
  :channel-id="channel.channelId"
  :channel-thumbnail="channel.authorThumbnails[channel.authorThumbnails.length - 1].url"
  @click="goToChannel(channel.channelId)"
/>

The problem is that the response from the Invidious API only contains a key named "authorId", not "channelId". This could be fixed by mapping the "channelId" field to "authorId" inside of the getChannelInfoInvidious function in ./src/renderer/views/Channel/Channel.js. There already is a map for the related channels, so this could be fixed with one new line of code inside that map.

// line 417 of src/renderer/views/Channel/Channel.js
this.relatedChannels = response.relatedChannels.map((channel) => {
  channel.authorThumbnails[channel.authorThumbnails.length - 1].url = channel.authorThumbnails[channel.authorThumbnails.length - 1].url.replace('https://yt3.ggpht.com', `${this.currentInvidiousInstance}/ggpht/`)
  // Mapping authorId to channelId
  channel.channelId = channel.authorId;
  return channel
})

Nightly Build

@MarmadileManteater MarmadileManteater added the bug Something isn't working label Aug 14, 2022
@ChunkyProgrammer
Copy link
Member

Would you like to create a PR for this issue or would you want someone else to create one?

@MarmadileManteater
Copy link
Contributor Author

I can make one.

MarmadileManteater added a commit to MarmadileManteater/FreeTubeAndroid that referenced this issue Aug 15, 2022
Added a line to map the field "authorId" to "channelId"
on the featured channels that come from the Invidious API
because the Channel view expects related channels to have
the property "channelId". This is related to FreeTubeApp#2481.
PrestonN pushed a commit that referenced this issue Aug 15, 2022
Added a line to map the field "authorId" to "channelId"
on the featured channels that come from the Invidious API
because the Channel view expects related channels to have
the property "channelId". This is related to #2481.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B: API issue bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants