Fix empty channels showing up as errored with RSS (#3824)

This commit is contained in:
absidue
2023-08-05 00:33:03 +00:00
committed by GitHub
parent e0fceedefd
commit b48d04700f
5 changed files with 33 additions and 6 deletions
@@ -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 []
}
@@ -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 []
}
@@ -14,10 +14,6 @@
right: 10px;
}
.channelBubble {
display: inline-block;
}
@media only screen and (max-width: 350px) {
.floatingTopButton {
position: absolute
@@ -14,7 +14,6 @@
:channel-name="channel.name"
:channel-id="channel.id"
:channel-thumbnail="channel.thumbnail"
class="channelBubble"
@click="goToChannel(channel.id)"
/>
</div>
@@ -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 []
}