1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00
* Added: New settings for hiding content from the directory based on tag, content flag, or title.
* Fixed: Certain page elements not being hidden correctly.
This commit is contained in:
SirStendec 2023-12-14 18:33:08 -05:00
parent 40865adba7
commit de09ec502d
3 changed files with 22 additions and 7 deletions

View file

@ -1,7 +1,7 @@
{
"name": "frankerfacez",
"author": "Dan Salvato LLC",
"version": "4.61.0",
"version": "4.62.0",
"description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true,
"license": "Apache-2.0",

View file

@ -43,7 +43,7 @@ export default class Twilight extends BaseSite {
}
async populateModules() {
const ctx = await require.context('site/modules', true, /(?:^(?:\.\/)?[^/]+|index)\.jsx?$/);
const ctx = await require.context('site/modules', true, /(?:^(?:\.\/)?[^/]+|index)\.[jt]sx?$/);
const modules = await this.loadFromContext(ctx, this.log);
this.log.info(`Loaded descriptions of ${Object.keys(modules).length} modules.`);
}
@ -439,4 +439,4 @@ Twilight.ROUTES = {
Twilight.DIALOG_EXCLUSIVE = '.moderation-root,.sunlight-root,.twilight-main,.twilight-minimal-root>div,#root>div>.tw-full-height,.clips-root,#root';
Twilight.DIALOG_MAXIMIZED = '.moderation-view-page > div[data-highlight-selector="main-grid"],.sunlight-page,.twilight-main,.twilight-minimal-root,#root .dashboard-side-nav+.tw-full-height,.clips-root>.tw-full-height .scrollable-area,.teams-page-body__outer-container .scrollable-area';
Twilight.DIALOG_SELECTOR = '.moderation-root,.sunlight-root,#root,.twilight-minimal-root>.tw-full-height,.clips-root>.tw-full-height .scrollable-area';
Twilight.DIALOG_SELECTOR = '.moderation-root,.sunlight-root,#root,.twilight-minimal-root>.tw-full-height,.clips-root>.tw-full-height .scrollable-area';

View file

@ -326,6 +326,17 @@ export default class Directory extends Module {
changed: () => this.updateCards()
});
this.settings.add('directory.wait-flags', {
default: true,
ui: {
path: 'Directory > Channels >> Appearance',
title: 'Hide Thumbnails for all channels until Content Flags have been loaded.',
description: 'We need to load content flags with a separate query, so they aren\'t immediately available to determine if a given stream should be hidden, or have its thumbnail blurred. This setting will blur ALL thumbnails until after we\'ve finished loading the necessary content flag information, ensuring you don\'t see a flash of anything you would rather not.',
component: 'setting-check-box'
},
changed: () => this.updateCards()
});
this.settings.add('directory.block-flags', {
default: [],
type: 'array_merge',
@ -576,13 +587,15 @@ export default class Directory extends Module {
const game = props.gameTitle || props.trackingProps?.categoryName || props.trackingProps?.category || props.contextualCardActionProps?.props?.categoryName,
tags = props.tagListProps?.freeformTags;
const blur_flags = this.settings.get('directory.blur-flags', []),
block_flags = this.settings.get('directory.block-flags', []);
const need_flags = this.settings.get('directory.wait-flags'),
blur_flags = this.settings.get('directory.blur-flags', []),
block_flags = this.settings.get('directory.block-flags', []),
has_flags = blur_flags.size > 0 || block_flags.size > 0;
if ( el._ffz_flags === undefined && (blur_flags.size || block_flags.size) ) {
if ( el._ffz_flags === undefined && has_flags ) {
el._ffz_flags = null;
this.twitch_data.getStreamFlags(null, props.channelLogin).then(data => {
el._ffz_flags = data;
el._ffz_flags = data ?? [];
this.updateCard(el);
});
}
@ -610,6 +623,8 @@ export default class Directory extends Module {
}
let should_blur = blur_tag;
if ( need_flags && has_flags && el._ffz_flags == null )
should_blur = true;
if ( ! should_blur )
should_blur = this.settings.provider.get('directory.game.hidden-thumbnails', []).includes(game);
if ( ! should_blur && blur_flags.size && el._ffz_flags ) {