Skip to content

Commit

Permalink
Fix empty channels showing up as errored with RSS (#3824)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Aug 5, 2023
1 parent e0fceed commit b48d047
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 6 deletions.
11 changes: 11 additions & 0 deletions src/renderer/components/subscriptions-live/subscriptions-live.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,17 @@ export default defineComponent({
const response = await fetch(feedUrl)

if (response.status === 404) {
// playlists don't exist if the channel was terminated but also if it doesn't have the tab,
// so we need to check the channel feed too before deciding it errored, as that only 404s if the channel was terminated

const response2 = await fetch(`https://www.youtube.com/feeds/videos.xml?channel_id=${channel.id}`, {
method: 'HEAD'
})

if (response2.status === 404) {
this.errorChannels.push(channel)
}

return []
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,17 @@ export default defineComponent({
const response = await fetch(feedUrl)

if (response.status === 404) {
// playlists don't exist if the channel was terminated but also if it doesn't have the tab,
// so we need to check the channel feed too before deciding it errored, as that only 404s if the channel was terminated

const response2 = await fetch(`https://www.youtube.com/feeds/videos.xml?channel_id=${channel.id}`, {
method: 'HEAD'
})

if (response2.status === 404) {
this.errorChannels.push(channel)
}

return []
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
right: 10px;
}

.channelBubble {
display: inline-block;
}

@media only screen and (max-width: 350px) {
.floatingTopButton {
position: absolute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
:channel-name="channel.name"
:channel-id="channel.id"
:channel-thumbnail="channel.thumbnail"
class="channelBubble"
@click="goToChannel(channel.id)"
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,17 @@ export default defineComponent({
const response = await fetch(feedUrl)

if (response.status === 404) {
this.errorChannels.push(channel)
// playlists don't exist if the channel was terminated but also if it doesn't have the tab,
// so we need to check the channel feed too before deciding it errored, as that only 404s if the channel was terminated

const response2 = await fetch(`https://www.youtube.com/feeds/videos.xml?channel_id=${channel.id}`, {
method: 'HEAD'
})

if (response2.status === 404) {
this.errorChannels.push(channel)
}

return []
}

Expand Down

0 comments on commit b48d047

Please sign in to comment.