Skip to content
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

Added buttons to hide hidden channels/text #6156

Merged
merged 16 commits into from
Dec 19, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ export default defineComponent({
showDistractionFreeTitles: function () {
return this.$store.getters.getShowDistractionFreeTitles
},
showAddedChannels: function () {
return this.$store.getters.getShowAddedChannels
},
showAddedKeywords: function () {
return this.$store.getters.getShowAddedKeywords
},
channelsHidden: function () {
return JSON.parse(this.$store.getters.getChannelsHidden).map((ch) => {
// Legacy support
Expand Down Expand Up @@ -224,6 +230,8 @@ export default defineComponent({
'updateHideSubscriptionsShorts',
'updateHideSubscriptionsLive',
'updateHideSubscriptionsCommunity',
'updateShowAddedChannels',
'updateShowAddedKeywords'
])
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,25 @@
</div>
</div>
<br class="hide-on-mobile">
<h4
class="groupTitle"
>
{{ $t('Settings.Distraction Free Settings.Sections.Content Filter') }}
</h4>
<div class="switchColumnGrid">
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Show Added Channels')"
:compact="true"
:default-value="showAddedChannels"
@change="updateShowAddedChannels"
/>
<ft-toggle-switch
:label="$t('Settings.Distraction Free Settings.Show Added Keywords')"
:compact="true"
:default-value="showAddedKeywords"
@change="updateShowAddedKeywords"
/>
</div>
<ft-flex-box>
<ft-input-tags
:disabled="channelHiderDisabled"
Expand All @@ -236,6 +255,7 @@
:tag-name-placeholder="$t('Settings.Distraction Free Settings.Hide Channels Placeholder')"
:show-action-button="true"
:tag-list="channelsHidden"
:show-tags="showAddedChannels"
:tooltip="$t('Tooltips.Distraction Free Settings.Hide Channels')"
:validate-tag-name="validateChannelId"
:find-tag-info="findChannelTagInfo"
Expand All @@ -252,6 +272,7 @@
:tag-name-placeholder="$t('Settings.Distraction Free Settings.Hide Videos and Playlists Containing Text Placeholder')"
:show-action-button="true"
:tag-list="forbiddenTitles"
:show-tags="showAddedKeywords"
:min-input-length="3"
:tooltip="$t('Tooltips.Distraction Free Settings.Hide Videos and Playlists Containing Text')"
@change="handleForbiddenTitles"
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/components/ft-input-tags/ft-input-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default defineComponent({
type: String,
required: true
},
showTags: {
type: Boolean,
required: true
},
minInputLength: {
type: Number,
default: 1
Expand Down
5 changes: 4 additions & 1 deletion src/renderer/components/ft-input-tags/ft-input-tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
:force-action-button-icon-name="['fas', 'arrow-right']"
@click="updateTags"
/>
<div class="ft-tag-box">
<div
v-if="showTags"
class="ft-tag-box"
>
<ul>
<li
v-for="tag in tagList"
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/store/modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ const state = {
screenshotFolderPath: '',
screenshotFilenamePattern: '%Y%M%D-%H%N%S',
settingsSectionSortEnabled: false,
showAddedChannels: true,
showAddedKeywords: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. These should be moved to below forbiddenTitles (coz they are related)
  2. I think maybe using showAddedChannelsHidden & showAddedForbiddenTitles would be better to clearly show that they are related.

fetchSubscriptionsAutomatically: true,
settingsPassword: '',
useDeArrowTitles: false,
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 @@ -484,6 +484,7 @@ Settings:
Channel Page: Channel Page
Watch Page: Watch Page
General: General
Content Filter: Content Filter
Hide Video Views: Hide Video Views
Hide Video Likes And Dislikes: Hide Video Likes And Dislikes
Hide Channel Subscribers: Hide Channel Subscribers
Expand Down Expand Up @@ -520,6 +521,8 @@ Settings:
Hide Subscriptions Shorts: Hide Subscriptions Shorts
Hide Subscriptions Live: Hide Subscriptions Live
Hide Subscriptions Community: Hide Subscriptions Community
Show Added Channels: Show Added Channels
Show Added Keywords: Show Added Keywords
Data Settings:
Data Settings: Data
Select Import Type: Select Import Type
Expand Down