block channels in trending too

This commit is contained in:
Bnyro 2022-08-27 16:44:01 +02:00
parent b46555fbcd
commit 4876ead6a3
5 changed files with 11 additions and 7 deletions

View file

@ -286,7 +286,7 @@
</div>
<br />
</div>
<h2 class="text-center" v-t="'actions.blocked_channels'"></h2>
<h2 class="text-center" v-t="'titles.misc'"></h2>
<label class="pref" for="blockedChannels">
<strong v-t="'actions.blocked_channels'" />
<input

View file

@ -143,9 +143,9 @@ export default {
isBlocked(result) {
if (!result.uploaderUrl) {
// item is a channel
return this.isChannelBlocked(result.url.replace("/channel/", ""));
return this.isChannelBlocked(result.url);
}
return this.isChannelBlocked(result.uploaderUrl.replace("/channel/", ""));
return this.isChannelBlocked(result.uploaderUrl);
},
},
};

View file

@ -1,5 +1,5 @@
<template>
<div>
<div v-if="!isBlocked">
<router-link
:to="{
path: '/watch',
@ -178,6 +178,9 @@ export default {
short() {
return this.video.duration > 0 && this.video.duration <= 61;
},
isBlocked() {
return this.isChannelBlocked(this.video.uploaderUrl);
},
},
components: { PlaylistAddModal },
};

View file

@ -10,7 +10,8 @@
"playlists": "Playlists",
"account": "Account",
"instance": "Instance",
"player": "Player"
"player": "Player",
"misc": "Miscellaneous"
},
"player": {
"watch_on": "Watch on {0}"
@ -98,7 +99,7 @@
"backup_preferences": "Backup preferences",
"restore_preferences": "Restore preferences",
"back_to_home": "Back to home",
"blocked_channels": "Blocked channels"
"blocked_channels": "Blocked channels (IDs, seperated by ',')"
},
"comment": {
"pinned_by": "Pinned by",

View file

@ -234,7 +234,7 @@ const mixin = {
isChannelBlocked(channelId) {
const blockedChannels = localStorage.getItem("blockedChannels");
if (!blockedChannels) return false;
return blockedChannels.split(",").includes(channelId);
return blockedChannels.split(",").includes(channelId.replace("/channel/", ""));
},
},
computed: {