Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.message {
color: var(--tertiary-text-color);
inline-size: fit-content;
margin-inline: auto;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<template>
<p
v-if="forceRssFeeds"
class="message"
>
{{ t('Subscriptions.Posts.Forced RSS Message') }}
</p>
<p
v-else-if="useRssFeeds"
class="message"
>
{{ t('Subscriptions.Posts.RSS Message', {
setting: t('Settings.Subscription Settings.Fetch Feeds from RSS'
)}) }}
</p>
<SubscriptionsTabUi
v-else
:is-loading="isLoading"
:video-list="postList"
:error-channels="errorChannels"
Expand All @@ -14,15 +29,15 @@

<script setup>
import { computed, onMounted, ref, shallowRef, watch } from 'vue'
import { useI18n } from '../composables/use-i18n-polyfill'
import { useI18n } from '../../composables/use-i18n-polyfill'

import SubscriptionsTabUi from './SubscriptionsTabUi/SubscriptionsTabUi.vue'
import SubscriptionsTabUi from '../SubscriptionsTabUi/SubscriptionsTabUi.vue'

import store from '../store/index'
import store from '../../store/index'

import { copyToClipboard, getRelativeTimeFromDate, showToast } from '../helpers/utils'
import { getLocalChannelCommunity } from '../helpers/api/local'
import { invidiousGetCommunityPosts } from '../helpers/api/invidious'
import { copyToClipboard, getRelativeTimeFromDate, showToast } from '../../helpers/utils'
import { getLocalChannelCommunity } from '../../helpers/api/local'
import { invidiousGetCommunityPosts } from '../../helpers/api/invidious'

const { t } = useI18n()

Expand All @@ -47,8 +62,13 @@ const subscriptionCacheReady = computed(() => store.getters.getSubscriptionCache
/** @type {import('vue').ComputedRef<boolean>} */
const fetchSubscriptionsAutomatically = computed(() => store.getters.getFetchSubscriptionsAutomatically)

/** @type {import('vue').ComputedRef<boolean>} */
const useRssFeeds = computed(() => store.getters.getUseRssFeeds)

const activeSubscriptionList = computed(() => store.getters.getActiveProfile.subscriptions)

const forceRssFeeds = computed(() => store.getters.getActiveProfile.subscriptions.length >= 125)

const cacheEntriesForAllActiveProfileChannels = computed(() => {
const postsCache = store.getters.getPostsCache
const entries = []
Expand Down Expand Up @@ -114,9 +134,11 @@ if (!subscriptionCacheReady.value) {
})
}

onMounted(() => {
loadPostsFromRemoteFirstPerWindowSometimes()
})
if (!useRssFeeds.value && !forceRssFeeds.value) {
onMounted(() => {
loadPostsFromRemoteFirstPerWindowSometimes()
})
}

function loadPostsFromRemoteFirstPerWindowSometimes() {
if (
Expand Down Expand Up @@ -292,3 +314,5 @@ async function getChannelPostsInvidious(channel) {
}
}
</script>

<style scoped src="./SubscriptionPosts.css" />
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
/>
<FtToggleSwitch
:label="$t('Settings.Subscription Settings.Fetch Feeds from RSS')"
:default-value="useRssFeeds"
:default-value="useRssFeeds || forceRssFeeds"
:tooltip="$t('Tooltips.Subscription Settings.Fetch Feeds from RSS')"
:disabled="forceRssFeeds"
compact
@change="updateUseRssFeeds"
/>
Expand Down Expand Up @@ -70,6 +71,8 @@ function updateFetchSubscriptionsAutomatically(value) {
/** @type {import('vue').ComputedRef<boolean>} */
const useRssFeeds = computed(() => store.getters.getUseRssFeeds)

const forceRssFeeds = computed(() => store.getters.getActiveProfile.subscriptions.length >= 125)

/**
* @param {boolean} value
*/
Expand Down
17 changes: 3 additions & 14 deletions src/renderer/views/Subscriptions/Subscriptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</div>
<!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -->
<div
v-if="visibleTabs.includes('community')"
v-if="!hideSubscriptionsCommunity"
ref="communityTab"
class="tab"
role="tab"
Expand Down Expand Up @@ -133,7 +133,7 @@ import FtFlexBox from '../../components/ft-flex-box/ft-flex-box.vue'
import SubscriptionsVideos from '../../components/SubscriptionsVideos.vue'
import SubscriptionsLive from '../../components/SubscriptionsLive.vue'
import SubscriptionsShorts from '../../components/SubscriptionsShorts.vue'
import SubscriptionsPosts from '../../components/SubscriptionsPosts.vue'
import SubscriptionsPosts from '../../components/SubscriptionPosts/SubscriptionsPosts.vue'

import store from '../../store/index'

Expand All @@ -157,16 +157,6 @@ const hideSubscriptionsCommunity = computed(() => {
return store.getters.getHideSubscriptionsCommunity
})

/** @type {import('vue').ComputedRef<any[]>} */
const activeSubscriptionList = computed(() => {
return store.getters.getActiveProfile.subscriptions
})

/** @type {import('vue').ComputedRef<boolean>} */
const useRssFeeds = computed(() => {
return store.getters.getUseRssFeeds
})

/** @type {import('vue').Ref<'videos' | 'shorts' | 'live' | 'community' | null>} */
const currentTab = ref('videos')

Expand Down Expand Up @@ -195,8 +185,7 @@ const visibleTabs = computed(() => {
tabs.push('live')
}

// community does not support rss
if (!hideSubscriptionsCommunity.value && !useRssFeeds.value && activeSubscriptionList.value.length < 125) {
if (!hideSubscriptionsCommunity.value) {
tabs.push('community')
}

Expand Down
3 changes: 3 additions & 0 deletions static/locales/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ Subscriptions:
Load More Posts: Load More Posts
Subscriptions Tabs: Subscriptions Tabs
All Subscription Tabs Hidden: 'All subscription tabs are hidden. To see content here, please unhide some tabs in the "{subsection}" section in "{settingsSection}".'
Posts:
RSS Message: The "{setting}" setting is enabled and YouTube does not provide RSS feeds for posts.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RSS Message: The "{setting}" setting is enabled and YouTube does not provide RSS feeds for posts.
RSS Message: The "{setting}" setting is enabled, but YouTube does not provide RSS feeds for posts. To view posts, disable this setting. To hide this tab, go to the "{subsection}" section in "{settingsSection}".

Forced RSS Message: This profile has a large number of subscriptions. Forcing RSS to avoid rate limiting. YouTube does not provide RSS feeds for posts.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Forced RSS Message: This profile has a large number of subscriptions. Forcing RSS to avoid rate limiting. YouTube does not provide RSS feeds for posts.
Forced RSS Message: RSS is forced for profiles with 125 or more subscriptions to avoid rate limiting. YouTube does not provide RSS feeds for posts. To disable forced RSS, reduce your subscription count or split your subscriptions across multiple profiles. To hide this tab, go to the "{subsection}" section in "{settingsSection}".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To disable forced RSS, reduce your subscription count or split your subscriptions across multiple profiles.

I would also like to link profiles to https://docs.freetubeapp.io/usage/profiles/

More: More
Channels:
Channels: Channels
Expand Down