mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
block channels in trending too
This commit is contained in:
parent
b46555fbcd
commit
4876ead6a3
5 changed files with 11 additions and 7 deletions
|
@ -286,7 +286,7 @@
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</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">
|
<label class="pref" for="blockedChannels">
|
||||||
<strong v-t="'actions.blocked_channels'" />
|
<strong v-t="'actions.blocked_channels'" />
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -143,9 +143,9 @@ export default {
|
||||||
isBlocked(result) {
|
isBlocked(result) {
|
||||||
if (!result.uploaderUrl) {
|
if (!result.uploaderUrl) {
|
||||||
// item is a channel
|
// 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);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div v-if="!isBlocked">
|
||||||
<router-link
|
<router-link
|
||||||
:to="{
|
:to="{
|
||||||
path: '/watch',
|
path: '/watch',
|
||||||
|
@ -178,6 +178,9 @@ export default {
|
||||||
short() {
|
short() {
|
||||||
return this.video.duration > 0 && this.video.duration <= 61;
|
return this.video.duration > 0 && this.video.duration <= 61;
|
||||||
},
|
},
|
||||||
|
isBlocked() {
|
||||||
|
return this.isChannelBlocked(this.video.uploaderUrl);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: { PlaylistAddModal },
|
components: { PlaylistAddModal },
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
"playlists": "Playlists",
|
"playlists": "Playlists",
|
||||||
"account": "Account",
|
"account": "Account",
|
||||||
"instance": "Instance",
|
"instance": "Instance",
|
||||||
"player": "Player"
|
"player": "Player",
|
||||||
|
"misc": "Miscellaneous"
|
||||||
},
|
},
|
||||||
"player": {
|
"player": {
|
||||||
"watch_on": "Watch on {0}"
|
"watch_on": "Watch on {0}"
|
||||||
|
@ -98,7 +99,7 @@
|
||||||
"backup_preferences": "Backup preferences",
|
"backup_preferences": "Backup preferences",
|
||||||
"restore_preferences": "Restore preferences",
|
"restore_preferences": "Restore preferences",
|
||||||
"back_to_home": "Back to home",
|
"back_to_home": "Back to home",
|
||||||
"blocked_channels": "Blocked channels"
|
"blocked_channels": "Blocked channels (IDs, seperated by ',')"
|
||||||
},
|
},
|
||||||
"comment": {
|
"comment": {
|
||||||
"pinned_by": "Pinned by",
|
"pinned_by": "Pinned by",
|
||||||
|
|
|
@ -234,7 +234,7 @@ const mixin = {
|
||||||
isChannelBlocked(channelId) {
|
isChannelBlocked(channelId) {
|
||||||
const blockedChannels = localStorage.getItem("blockedChannels");
|
const blockedChannels = localStorage.getItem("blockedChannels");
|
||||||
if (!blockedChannels) return false;
|
if (!blockedChannels) return false;
|
||||||
return blockedChannels.split(",").includes(channelId);
|
return blockedChannels.split(",").includes(channelId.replace("/channel/", ""));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue