refactor: rename blacklist to blocklist (#2157)
Signed-off-by: 0xsysr3ll <0xsysr3ll@pm.me> Co-authored-by: fallenbagel <98979876+Fallenbagel@users.noreply.github.com> Co-authored-by: 0xsysr3ll <0xsysr3ll@pm.me> Co-authored-by: gauthier-th <mail@gauthierth.fr>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import BlacklistedTagsBadge from '@app/components/BlacklistedTagsBadge';
|
||||
import BlocklistedTagsBadge from '@app/components/BlocklistedTagsBadge';
|
||||
import Badge from '@app/components/Common/Badge';
|
||||
import Button from '@app/components/Common/Button';
|
||||
import CachedImage from '@app/components/Common/CachedImage';
|
||||
@@ -20,9 +20,9 @@ import {
|
||||
TrashIcon,
|
||||
} from '@heroicons/react/24/solid';
|
||||
import type {
|
||||
BlacklistItem,
|
||||
BlacklistResultsResponse,
|
||||
} from '@server/interfaces/api/blacklistInterfaces';
|
||||
BlocklistItem,
|
||||
BlocklistResultsResponse,
|
||||
} from '@server/interfaces/api/blocklistInterfaces';
|
||||
import type { MovieDetails } from '@server/models/Movie';
|
||||
import type { TvDetails } from '@server/models/Tv';
|
||||
import axios from 'axios';
|
||||
@@ -35,31 +35,31 @@ import { FormattedRelativeTime, useIntl } from 'react-intl';
|
||||
import { useToasts } from 'react-toast-notifications';
|
||||
import useSWR from 'swr';
|
||||
|
||||
const messages = defineMessages('components.Blacklist', {
|
||||
blacklistsettings: 'Blacklist Settings',
|
||||
blacklistSettingsDescription: 'Manage blacklisted media.',
|
||||
const messages = defineMessages('components.Blocklist', {
|
||||
blocklistsettings: 'Blocklist Settings',
|
||||
blocklistSettingsDescription: 'Manage blocklisted media.',
|
||||
mediaName: 'Name',
|
||||
mediaType: 'Type',
|
||||
mediaTmdbId: 'tmdb Id',
|
||||
blacklistdate: 'date',
|
||||
blacklistedby: '{date} by {user}',
|
||||
blacklistNotFoundError: '<strong>{title}</strong> is not blacklisted.',
|
||||
blocklistdate: 'date',
|
||||
blocklistedby: '{date} by {user}',
|
||||
blocklistNotFoundError: '<strong>{title}</strong> is not blocklisted.',
|
||||
filterManual: 'Manual',
|
||||
filterBlacklistedTags: 'Blacklisted Tags',
|
||||
showAllBlacklisted: 'Show All Blacklisted Media',
|
||||
filterBlocklistedTags: 'Blocklisted Tags',
|
||||
showAllBlocklisted: 'Show All Blocklisted Media',
|
||||
});
|
||||
|
||||
enum Filter {
|
||||
ALL = 'all',
|
||||
MANUAL = 'manual',
|
||||
BLACKLISTEDTAGS = 'blacklistedTags',
|
||||
BLOCKLISTEDTAGS = 'blocklistedTags',
|
||||
}
|
||||
|
||||
const isMovie = (movie: MovieDetails | TvDetails): movie is MovieDetails => {
|
||||
return (movie as MovieDetails).title !== undefined;
|
||||
};
|
||||
|
||||
const Blacklist = () => {
|
||||
const Blocklist = () => {
|
||||
const [currentPageSize, setCurrentPageSize] = useState<number>(10);
|
||||
const [searchFilter, debouncedSearchFilter, setSearchFilter] =
|
||||
useDebouncedState('');
|
||||
@@ -75,8 +75,8 @@ const Blacklist = () => {
|
||||
data,
|
||||
error,
|
||||
mutate: revalidate,
|
||||
} = useSWR<BlacklistResultsResponse>(
|
||||
`/api/v1/blacklist/?take=${currentPageSize}&skip=${
|
||||
} = useSWR<BlocklistResultsResponse>(
|
||||
`/api/v1/blocklist/?take=${currentPageSize}&skip=${
|
||||
pageIndex * currentPageSize
|
||||
}&filter=${currentFilter}${
|
||||
debouncedSearchFilter ? `&search=${debouncedSearchFilter}` : ''
|
||||
@@ -107,9 +107,9 @@ const Blacklist = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageTitle title={[intl.formatMessage(globalMessages.blacklist)]} />
|
||||
<PageTitle title={[intl.formatMessage(globalMessages.blocklist)]} />
|
||||
<div className="mb-4 flex flex-col justify-between lg:flex-row lg:items-end">
|
||||
<Header>{intl.formatMessage(globalMessages.blacklist)}</Header>
|
||||
<Header>{intl.formatMessage(globalMessages.blocklist)}</Header>
|
||||
|
||||
<div className="mt-2 flex flex-grow flex-col sm:flex-row lg:flex-grow-0">
|
||||
<div className="mb-2 flex flex-grow sm:mb-0 sm:mr-2 lg:flex-grow-0">
|
||||
@@ -137,8 +137,8 @@ const Blacklist = () => {
|
||||
<option value="manual">
|
||||
{intl.formatMessage(messages.filterManual)}
|
||||
</option>
|
||||
<option value="blacklistedTags">
|
||||
{intl.formatMessage(messages.filterBlacklistedTags)}
|
||||
<option value="blocklistedTags">
|
||||
{intl.formatMessage(messages.filterBlocklistedTags)}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -170,16 +170,16 @@ const Blacklist = () => {
|
||||
buttonType="primary"
|
||||
onClick={() => setCurrentFilter(Filter.ALL)}
|
||||
>
|
||||
{intl.formatMessage(messages.showAllBlacklisted)}
|
||||
{intl.formatMessage(messages.showAllBlocklisted)}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
data.results.map((item: BlacklistItem) => {
|
||||
data.results.map((item: BlocklistItem) => {
|
||||
return (
|
||||
<div className="py-2" key={`request-list-${item.tmdbId}`}>
|
||||
<BlacklistedItem item={item} revalidateList={revalidate} />
|
||||
<BlocklistedItem item={item} revalidateList={revalidate} />
|
||||
</div>
|
||||
);
|
||||
})
|
||||
@@ -260,14 +260,14 @@ const Blacklist = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Blacklist;
|
||||
export default Blocklist;
|
||||
|
||||
interface BlacklistedItemProps {
|
||||
item: BlacklistItem;
|
||||
interface BlocklistedItemProps {
|
||||
item: BlocklistItem;
|
||||
revalidateList: () => void;
|
||||
}
|
||||
|
||||
const BlacklistedItem = ({ item, revalidateList }: BlacklistedItemProps) => {
|
||||
const BlocklistedItem = ({ item, revalidateList }: BlocklistedItemProps) => {
|
||||
const [isUpdating, setIsUpdating] = useState<boolean>(false);
|
||||
const { addToast } = useToasts();
|
||||
const { ref, inView } = useInView({
|
||||
@@ -293,15 +293,15 @@ const BlacklistedItem = ({ item, revalidateList }: BlacklistedItemProps) => {
|
||||
);
|
||||
}
|
||||
|
||||
const removeFromBlacklist = async (tmdbId: number, title?: string) => {
|
||||
const removeFromBlocklist = async (tmdbId: number, title?: string) => {
|
||||
setIsUpdating(true);
|
||||
|
||||
try {
|
||||
await axios.delete(`/api/v1/blacklist/${tmdbId}`);
|
||||
await axios.delete(`/api/v1/blocklist/${tmdbId}`);
|
||||
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.removeFromBlacklistSuccess, {
|
||||
{intl.formatMessage(globalMessages.removeFromBlocklistSuccess, {
|
||||
title,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -309,7 +309,7 @@ const BlacklistedItem = ({ item, revalidateList }: BlacklistedItemProps) => {
|
||||
{ appearance: 'success', autoDismiss: true }
|
||||
);
|
||||
} catch {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
@@ -389,17 +389,17 @@ const BlacklistedItem = ({ item, revalidateList }: BlacklistedItemProps) => {
|
||||
<div className="card-field">
|
||||
<span className="card-field-name">Status</span>
|
||||
<Badge badgeType="danger">
|
||||
{intl.formatMessage(globalMessages.blacklisted)}
|
||||
{intl.formatMessage(globalMessages.blocklisted)}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
{item.createdAt && (
|
||||
<div className="card-field">
|
||||
<span className="card-field-name">
|
||||
{intl.formatMessage(globalMessages.blacklisted)}
|
||||
{intl.formatMessage(globalMessages.blocklisted)}
|
||||
</span>
|
||||
<span className="flex truncate text-sm text-gray-300">
|
||||
{intl.formatMessage(messages.blacklistedby, {
|
||||
{intl.formatMessage(messages.blocklistedby, {
|
||||
date: (
|
||||
<FormattedRelativeTime
|
||||
value={Math.floor(
|
||||
@@ -426,9 +426,9 @@ const BlacklistedItem = ({ item, revalidateList }: BlacklistedItemProps) => {
|
||||
</span>
|
||||
</span>
|
||||
</Link>
|
||||
) : item.blacklistedTags ? (
|
||||
) : item.blocklistedTags ? (
|
||||
<span className="ml-1">
|
||||
<BlacklistedTagsBadge data={item} />
|
||||
<BlocklistedTagsBadge data={item} />
|
||||
</span>
|
||||
) : (
|
||||
<span className="ml-1 truncate text-sm font-semibold">
|
||||
@@ -457,10 +457,10 @@ const BlacklistedItem = ({ item, revalidateList }: BlacklistedItemProps) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="z-10 mt-4 flex w-full flex-col justify-center space-y-2 pl-4 pr-4 xl:mt-0 xl:w-96 xl:items-end xl:pl-0">
|
||||
{hasPermission(Permission.MANAGE_BLACKLIST) && (
|
||||
{hasPermission(Permission.MANAGE_BLOCKLIST) && (
|
||||
<ConfirmButton
|
||||
onClick={() =>
|
||||
removeFromBlacklist(
|
||||
removeFromBlocklist(
|
||||
item.tmdbId,
|
||||
title && (isMovie(title) ? title.title : title.name)
|
||||
)
|
||||
@@ -474,7 +474,7 @@ const BlacklistedItem = ({ item, revalidateList }: BlacklistedItemProps) => {
|
||||
>
|
||||
<TrashIcon />
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.removefromBlacklist)}
|
||||
{intl.formatMessage(globalMessages.removefromBlocklist)}
|
||||
</span>
|
||||
</ConfirmButton>
|
||||
)}
|
||||
@@ -1,4 +1,4 @@
|
||||
import BlacklistedTagsBadge from '@app/components/BlacklistedTagsBadge';
|
||||
import BlocklistedTagsBadge from '@app/components/BlocklistedTagsBadge';
|
||||
import Badge from '@app/components/Common/Badge';
|
||||
import Button from '@app/components/Common/Button';
|
||||
import LoadingSpinner from '@app/components/Common/LoadingSpinner';
|
||||
@@ -7,7 +7,7 @@ import { useUser } from '@app/hooks/useUser';
|
||||
import globalMessages from '@app/i18n/globalMessages';
|
||||
import defineMessages from '@app/utils/defineMessages';
|
||||
import { CalendarIcon, TrashIcon, UserIcon } from '@heroicons/react/24/solid';
|
||||
import type { Blacklist } from '@server/entity/Blacklist';
|
||||
import type { Blocklist } from '@server/entity/Blocklist';
|
||||
import axios from 'axios';
|
||||
import Link from 'next/link';
|
||||
import { useState } from 'react';
|
||||
@@ -15,37 +15,37 @@ import { useIntl } from 'react-intl';
|
||||
import { useToasts } from 'react-toast-notifications';
|
||||
import useSWR from 'swr';
|
||||
|
||||
const messages = defineMessages('component.BlacklistBlock', {
|
||||
blacklistedby: 'Blacklisted By',
|
||||
blacklistdate: 'Blacklisted date',
|
||||
const messages = defineMessages('component.BlocklistBlock', {
|
||||
blocklistedby: 'Blocklisted By',
|
||||
blocklistdate: 'Blocklisted date',
|
||||
});
|
||||
|
||||
interface BlacklistBlockProps {
|
||||
interface BlocklistBlockProps {
|
||||
tmdbId: number;
|
||||
onUpdate?: () => void;
|
||||
onDelete?: () => void;
|
||||
}
|
||||
|
||||
const BlacklistBlock = ({
|
||||
const BlocklistBlock = ({
|
||||
tmdbId,
|
||||
onUpdate,
|
||||
onDelete,
|
||||
}: BlacklistBlockProps) => {
|
||||
}: BlocklistBlockProps) => {
|
||||
const { user } = useUser();
|
||||
const intl = useIntl();
|
||||
const [isUpdating, setIsUpdating] = useState(false);
|
||||
const { addToast } = useToasts();
|
||||
const { data } = useSWR<Blacklist>(`/api/v1/blacklist/${tmdbId}`);
|
||||
const { data } = useSWR<Blocklist>(`/api/v1/blocklist/${tmdbId}`);
|
||||
|
||||
const removeFromBlacklist = async (tmdbId: number, title?: string) => {
|
||||
const removeFromBlocklist = async (tmdbId: number, title?: string) => {
|
||||
setIsUpdating(true);
|
||||
|
||||
try {
|
||||
await axios.delete('/api/v1/blacklist/' + tmdbId);
|
||||
await axios.delete('/api/v1/blocklist/' + tmdbId);
|
||||
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.removeFromBlacklistSuccess, {
|
||||
{intl.formatMessage(globalMessages.removeFromBlocklistSuccess, {
|
||||
title,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -53,7 +53,7 @@ const BlacklistBlock = ({
|
||||
{ appearance: 'success', autoDismiss: true }
|
||||
);
|
||||
} catch {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
@@ -80,7 +80,7 @@ const BlacklistBlock = ({
|
||||
<div className="white mb-1 flex flex-nowrap">
|
||||
{data.user ? (
|
||||
<>
|
||||
<Tooltip content={intl.formatMessage(messages.blacklistedby)}>
|
||||
<Tooltip content={intl.formatMessage(messages.blocklistedby)}>
|
||||
<UserIcon className="mr-1.5 h-5 w-5 min-w-0 flex-shrink-0" />
|
||||
</Tooltip>
|
||||
<span className="w-40 truncate md:w-auto">
|
||||
@@ -97,23 +97,23 @@ const BlacklistBlock = ({
|
||||
</Link>
|
||||
</span>
|
||||
</>
|
||||
) : data.blacklistedTags ? (
|
||||
) : data.blocklistedTags ? (
|
||||
<>
|
||||
<span className="w-40 truncate md:w-auto">
|
||||
{intl.formatMessage(messages.blacklistedby)}:
|
||||
{intl.formatMessage(messages.blocklistedby)}:
|
||||
</span>
|
||||
<BlacklistedTagsBadge data={data} />
|
||||
<BlocklistedTagsBadge data={data} />
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
<div className="ml-2 flex flex-shrink-0 flex-wrap">
|
||||
<Tooltip
|
||||
content={intl.formatMessage(globalMessages.removefromBlacklist)}
|
||||
content={intl.formatMessage(globalMessages.removefromBlocklist)}
|
||||
>
|
||||
<Button
|
||||
buttonType="danger"
|
||||
onClick={() => removeFromBlacklist(data.tmdbId, data.title)}
|
||||
onClick={() => removeFromBlocklist(data.tmdbId, data.title)}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
<TrashIcon className="icon-sm" />
|
||||
@@ -125,12 +125,12 @@ const BlacklistBlock = ({
|
||||
<div className="sm:flex">
|
||||
<div className="mr-6 flex items-center text-sm leading-5">
|
||||
<Badge badgeType="danger">
|
||||
{intl.formatMessage(globalMessages.blacklisted)}
|
||||
{intl.formatMessage(globalMessages.blocklisted)}
|
||||
</Badge>
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt-2 flex items-center text-sm leading-5 sm:mt-0">
|
||||
<Tooltip content={intl.formatMessage(messages.blacklistdate)}>
|
||||
<Tooltip content={intl.formatMessage(messages.blocklistdate)}>
|
||||
<CalendarIcon className="mr-1.5 h-5 w-5 flex-shrink-0" />
|
||||
</Tooltip>
|
||||
<span>
|
||||
@@ -146,4 +146,4 @@ const BlacklistBlock = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default BlacklistBlock;
|
||||
export default BlocklistBlock;
|
||||
@@ -8,7 +8,7 @@ import axios from 'axios';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useIntl } from 'react-intl';
|
||||
|
||||
interface BlacklistModalProps {
|
||||
interface BlocklistModalProps {
|
||||
tmdbId: number;
|
||||
type: 'movie' | 'tv' | 'collection';
|
||||
show: boolean;
|
||||
@@ -17,8 +17,8 @@ interface BlacklistModalProps {
|
||||
isUpdating?: boolean;
|
||||
}
|
||||
|
||||
const messages = defineMessages('component.BlacklistModal', {
|
||||
blacklisting: 'Blacklisting',
|
||||
const messages = defineMessages('component.BlocklistModal', {
|
||||
blocklisting: 'Blocklisting',
|
||||
});
|
||||
|
||||
const isMovie = (
|
||||
@@ -28,14 +28,14 @@ const isMovie = (
|
||||
return (movie as MovieDetails).title !== undefined;
|
||||
};
|
||||
|
||||
const BlacklistModal = ({
|
||||
const BlocklistModal = ({
|
||||
tmdbId,
|
||||
type,
|
||||
show,
|
||||
onComplete,
|
||||
onCancel,
|
||||
isUpdating,
|
||||
}: BlacklistModalProps) => {
|
||||
}: BlocklistModalProps) => {
|
||||
const intl = useIntl();
|
||||
const [data, setData] = useState<TvDetails | MovieDetails | null>(null);
|
||||
const [error, setError] = useState(null);
|
||||
@@ -67,7 +67,7 @@ const BlacklistModal = ({
|
||||
<Modal
|
||||
loading={!data && !error}
|
||||
backgroundClickable
|
||||
title={`${intl.formatMessage(globalMessages.blacklist)} ${
|
||||
title={`${intl.formatMessage(globalMessages.blocklist)} ${
|
||||
isMovie(data)
|
||||
? intl.formatMessage(globalMessages.movie)
|
||||
: intl.formatMessage(globalMessages.tvshow)
|
||||
@@ -77,8 +77,8 @@ const BlacklistModal = ({
|
||||
onOk={onComplete}
|
||||
okText={
|
||||
isUpdating
|
||||
? intl.formatMessage(messages.blacklisting)
|
||||
: intl.formatMessage(globalMessages.blacklist)
|
||||
? intl.formatMessage(messages.blocklisting)
|
||||
: intl.formatMessage(globalMessages.blocklist)
|
||||
}
|
||||
okButtonType="danger"
|
||||
okDisabled={isUpdating}
|
||||
@@ -88,4 +88,4 @@ const BlacklistModal = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default BlacklistModal;
|
||||
export default BlocklistModal;
|
||||
@@ -2,31 +2,31 @@ import Badge from '@app/components/Common/Badge';
|
||||
import Tooltip from '@app/components/Common/Tooltip';
|
||||
import defineMessages from '@app/utils/defineMessages';
|
||||
import { TagIcon } from '@heroicons/react/20/solid';
|
||||
import type { BlacklistItem } from '@server/interfaces/api/blacklistInterfaces';
|
||||
import type { BlocklistItem } from '@server/interfaces/api/blocklistInterfaces';
|
||||
import type { Keyword } from '@server/models/common';
|
||||
import axios from 'axios';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useIntl } from 'react-intl';
|
||||
|
||||
const messages = defineMessages('components.Settings', {
|
||||
blacklistedTagsText: 'Blacklisted Tags',
|
||||
blocklistedTagsText: 'Blocklisted Tags',
|
||||
});
|
||||
|
||||
interface BlacklistedTagsBadgeProps {
|
||||
data: BlacklistItem;
|
||||
interface BlocklistedTagsBadgeProps {
|
||||
data: BlocklistItem;
|
||||
}
|
||||
|
||||
const BlacklistedTagsBadge = ({ data }: BlacklistedTagsBadgeProps) => {
|
||||
const [tagNamesBlacklistedFor, setTagNamesBlacklistedFor] =
|
||||
const BlocklistedTagsBadge = ({ data }: BlocklistedTagsBadgeProps) => {
|
||||
const [tagNamesBlocklistedFor, setTagNamesBlocklistedFor] =
|
||||
useState<string>('Loading...');
|
||||
const intl = useIntl();
|
||||
|
||||
useEffect(() => {
|
||||
if (!data.blacklistedTags) {
|
||||
if (!data.blocklistedTags) {
|
||||
return;
|
||||
}
|
||||
|
||||
const keywordIds = data.blacklistedTags.slice(1, -1).split(',');
|
||||
const keywordIds = data.blocklistedTags.slice(1, -1).split(',');
|
||||
Promise.all(
|
||||
keywordIds.map(async (keywordId) => {
|
||||
const { data } = await axios.get<Keyword | null>(
|
||||
@@ -35,13 +35,13 @@ const BlacklistedTagsBadge = ({ data }: BlacklistedTagsBadgeProps) => {
|
||||
return data?.name || `[Invalid: ${keywordId}]`;
|
||||
})
|
||||
).then((keywords) => {
|
||||
setTagNamesBlacklistedFor(keywords.join(', '));
|
||||
setTagNamesBlocklistedFor(keywords.join(', '));
|
||||
});
|
||||
}, [data.blacklistedTags]);
|
||||
}, [data.blocklistedTags]);
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
content={tagNamesBlacklistedFor}
|
||||
content={tagNamesBlocklistedFor}
|
||||
tooltipConfig={{ followCursor: false }}
|
||||
>
|
||||
<Badge
|
||||
@@ -49,10 +49,10 @@ const BlacklistedTagsBadge = ({ data }: BlacklistedTagsBadgeProps) => {
|
||||
className="items-center border border-red-500 !text-red-400"
|
||||
>
|
||||
<TagIcon className="mr-1 h-4" />
|
||||
{intl.formatMessage(messages.blacklistedTagsText)}
|
||||
{intl.formatMessage(messages.blocklistedTagsText)}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
|
||||
export default BlacklistedTagsBadge;
|
||||
export default BlocklistedTagsBadge;
|
||||
@@ -26,19 +26,19 @@ import { components } from 'react-select';
|
||||
import AsyncSelect from 'react-select/async';
|
||||
|
||||
const messages = defineMessages('components.Settings', {
|
||||
copyBlacklistedTags: 'Copied blacklisted tags to clipboard.',
|
||||
copyBlacklistedTagsTip: 'Copy blacklisted tag configuration',
|
||||
copyBlacklistedTagsEmpty: 'Nothing to copy',
|
||||
importBlacklistedTagsTip: 'Import blacklisted tag configuration',
|
||||
clearBlacklistedTagsConfirm:
|
||||
'Are you sure you want to clear the blacklisted tags?',
|
||||
copyBlocklistedTags: 'Copied blocklisted tags to clipboard.',
|
||||
copyBlocklistedTagsTip: 'Copy blocklisted tag configuration',
|
||||
copyBlocklistedTagsEmpty: 'Nothing to copy',
|
||||
importBlocklistedTagsTip: 'Import blocklisted tag configuration',
|
||||
clearBlocklistedTagsConfirm:
|
||||
'Are you sure you want to clear the blocklisted tags?',
|
||||
yes: 'Yes',
|
||||
no: 'No',
|
||||
searchKeywords: 'Search keywords…',
|
||||
starttyping: 'Starting typing to search.',
|
||||
nooptions: 'No results.',
|
||||
blacklistedTagImportTitle: 'Import Blacklisted Tag Configuration',
|
||||
blacklistedTagImportInstructions: 'Paste blacklist tag configuration below.',
|
||||
blocklistedTagImportTitle: 'Import Blocklisted Tag Configuration',
|
||||
blocklistedTagImportInstructions: 'Paste blocklist tag configuration below.',
|
||||
valueRequired: 'You must provide a value.',
|
||||
noSpecialCharacters:
|
||||
'Configuration must be a comma delimited list of TMDB keyword ids, and must not start or end with a comma.',
|
||||
@@ -50,13 +50,13 @@ type SingleVal = {
|
||||
value: number;
|
||||
};
|
||||
|
||||
type BlacklistedTagsSelectorProps = {
|
||||
type BlocklistedTagsSelectorProps = {
|
||||
defaultValue?: string;
|
||||
};
|
||||
|
||||
const BlacklistedTagsSelector = ({
|
||||
const BlocklistedTagsSelector = ({
|
||||
defaultValue,
|
||||
}: BlacklistedTagsSelectorProps) => {
|
||||
}: BlocklistedTagsSelectorProps) => {
|
||||
const { setFieldValue } = useFormikContext();
|
||||
const [value, setValue] = useState<string | undefined>(defaultValue);
|
||||
const intl = useIntl();
|
||||
@@ -68,7 +68,7 @@ const BlacklistedTagsSelector = ({
|
||||
const strVal = value?.map((v) => v.value).join(',');
|
||||
setSelectorValue(value);
|
||||
setValue(strVal);
|
||||
setFieldValue('blacklistedTags', strVal);
|
||||
setFieldValue('blocklistedTags', strVal);
|
||||
},
|
||||
[setSelectorValue, setValue, setFieldValue]
|
||||
);
|
||||
@@ -91,15 +91,15 @@ const BlacklistedTagsSelector = ({
|
||||
<CopyButton
|
||||
textToCopy={value ?? ''}
|
||||
disabled={copyDisabled}
|
||||
toastMessage={intl.formatMessage(messages.copyBlacklistedTags)}
|
||||
toastMessage={intl.formatMessage(messages.copyBlocklistedTags)}
|
||||
tooltipContent={intl.formatMessage(
|
||||
copyDisabled
|
||||
? messages.copyBlacklistedTagsEmpty
|
||||
: messages.copyBlacklistedTagsTip
|
||||
? messages.copyBlocklistedTagsEmpty
|
||||
: messages.copyBlocklistedTagsTip
|
||||
)}
|
||||
tooltipConfig={{ followCursor: false }}
|
||||
/>
|
||||
<BlacklistedTagsImportButton setSelector={update} />
|
||||
<BlocklistedTagsImportButton setSelector={update} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -162,7 +162,7 @@ const ControlledKeywordSelector = ({
|
||||
|
||||
return (
|
||||
<AsyncSelect
|
||||
key={`keyword-select-blacklistedTags`}
|
||||
key={`keyword-select-blocklistedTags`}
|
||||
inputId="data"
|
||||
isMulti
|
||||
className="react-select-container"
|
||||
@@ -181,13 +181,13 @@ const ControlledKeywordSelector = ({
|
||||
);
|
||||
};
|
||||
|
||||
type BlacklistedTagsImportButtonProps = {
|
||||
type BlocklistedTagsImportButtonProps = {
|
||||
setSelector: (value: MultiValue<SingleVal>) => void;
|
||||
};
|
||||
|
||||
const BlacklistedTagsImportButton = ({
|
||||
const BlocklistedTagsImportButton = ({
|
||||
setSelector,
|
||||
}: BlacklistedTagsImportButtonProps) => {
|
||||
}: BlocklistedTagsImportButtonProps) => {
|
||||
const [show, setShow] = useState(false);
|
||||
const formRef = useRef<HTMLFormElement>(null);
|
||||
const intl = useIntl();
|
||||
@@ -218,17 +218,17 @@ const BlacklistedTagsImportButton = ({
|
||||
show={show}
|
||||
>
|
||||
<Modal
|
||||
title={intl.formatMessage(messages.blacklistedTagImportTitle)}
|
||||
title={intl.formatMessage(messages.blocklistedTagImportTitle)}
|
||||
okText="Confirm"
|
||||
onOk={onConfirm}
|
||||
onCancel={() => setShow(false)}
|
||||
>
|
||||
<BlacklistedTagImportForm ref={formRef} setSelector={setSelector} />
|
||||
<BlocklistedTagImportForm ref={formRef} setSelector={setSelector} />
|
||||
</Modal>
|
||||
</Transition>
|
||||
|
||||
<Tooltip
|
||||
content={intl.formatMessage(messages.importBlacklistedTagsTip)}
|
||||
content={intl.formatMessage(messages.importBlocklistedTagsTip)}
|
||||
tooltipConfig={{ followCursor: false }}
|
||||
>
|
||||
<button className="input-action" onClick={onClick} type="button">
|
||||
@@ -239,11 +239,11 @@ const BlacklistedTagsImportButton = ({
|
||||
);
|
||||
};
|
||||
|
||||
type BlacklistedTagImportFormProps = BlacklistedTagsImportButtonProps;
|
||||
type BlocklistedTagImportFormProps = BlocklistedTagsImportButtonProps;
|
||||
|
||||
const BlacklistedTagImportForm = forwardRef<
|
||||
const BlocklistedTagImportForm = forwardRef<
|
||||
Partial<HTMLFormElement>,
|
||||
BlacklistedTagImportFormProps
|
||||
BlocklistedTagImportFormProps
|
||||
>((props, ref) => {
|
||||
const { setSelector } = props;
|
||||
const intl = useIntl();
|
||||
@@ -306,7 +306,7 @@ const BlacklistedTagImportForm = forwardRef<
|
||||
<form onSubmit={handleSubmit}>
|
||||
<div>
|
||||
<label htmlFor="value">
|
||||
{intl.formatMessage(messages.blacklistedTagImportInstructions)}
|
||||
{intl.formatMessage(messages.blocklistedTagImportInstructions)}
|
||||
</label>
|
||||
<textarea
|
||||
id="value"
|
||||
@@ -392,7 +392,7 @@ const VerifyClearIndicator = <
|
||||
show={show}
|
||||
>
|
||||
<Modal
|
||||
subTitle={intl.formatMessage(messages.clearBlacklistedTagsConfirm)}
|
||||
subTitle={intl.formatMessage(messages.clearBlocklistedTagsConfirm)}
|
||||
okText={intl.formatMessage(messages.yes)}
|
||||
cancelText={intl.formatMessage(messages.no)}
|
||||
onOk={clearValue}
|
||||
@@ -406,4 +406,4 @@ const VerifyClearIndicator = <
|
||||
);
|
||||
};
|
||||
|
||||
export default BlacklistedTagsSelector;
|
||||
export default BlocklistedTagsSelector;
|
||||
@@ -188,8 +188,8 @@ const CollectionDetails = ({ collection }: CollectionDetailsProps) => {
|
||||
);
|
||||
}
|
||||
|
||||
const blacklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLACKLIST, Permission.VIEW_BLACKLIST],
|
||||
const blocklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLOCKLIST, Permission.VIEW_BLOCKLIST],
|
||||
{ type: 'or' }
|
||||
);
|
||||
|
||||
@@ -349,8 +349,8 @@ const CollectionDetails = ({ collection }: CollectionDetailsProps) => {
|
||||
isEmpty={data.parts.length === 0}
|
||||
items={data.parts
|
||||
.filter((title) => {
|
||||
if (!blacklistVisibility)
|
||||
return title.mediaInfo?.status !== MediaStatus.BLACKLISTED;
|
||||
if (!blocklistVisibility)
|
||||
return title.mediaInfo?.status !== MediaStatus.BLOCKLISTED;
|
||||
return title;
|
||||
})
|
||||
.map((title) => (
|
||||
|
||||
@@ -37,8 +37,8 @@ const ListView = ({
|
||||
const { hasPermission } = useUser();
|
||||
useVerticalScroll(onScrollBottom, !isLoading && !isEmpty && !isReachingEnd);
|
||||
|
||||
const blacklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLACKLIST, Permission.VIEW_BLACKLIST],
|
||||
const blocklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLOCKLIST, Permission.VIEW_BLOCKLIST],
|
||||
{ type: 'or' }
|
||||
);
|
||||
|
||||
@@ -66,10 +66,10 @@ const ListView = ({
|
||||
})}
|
||||
{items
|
||||
?.filter((title) => {
|
||||
if (!blacklistVisibility)
|
||||
if (!blocklistVisibility)
|
||||
return (
|
||||
(title as TvResult | MovieResult).mediaInfo?.status !==
|
||||
MediaStatus.BLACKLISTED
|
||||
MediaStatus.BLOCKLISTED
|
||||
);
|
||||
return title;
|
||||
})
|
||||
|
||||
@@ -50,7 +50,7 @@ const StatusBadgeMini = ({
|
||||
);
|
||||
indicatorIcon = <BellIcon />;
|
||||
break;
|
||||
case MediaStatus.BLACKLISTED:
|
||||
case MediaStatus.BLOCKLISTED:
|
||||
badgeStyle.push('bg-red-500 border-white-400 ring-white-400 text-white');
|
||||
indicatorIcon = <EyeSlashIcon />;
|
||||
break;
|
||||
|
||||
@@ -100,14 +100,14 @@ const MobileMenu = ({
|
||||
activeRegExp: /^\/requests/,
|
||||
},
|
||||
{
|
||||
href: '/blacklist',
|
||||
content: intl.formatMessage(menuMessages.blacklist),
|
||||
href: '/blocklist',
|
||||
content: intl.formatMessage(menuMessages.blocklist),
|
||||
svgIcon: <EyeSlashIcon className="h-6 w-6" />,
|
||||
svgIconSelected: <FilledEyeSlashIcon className="h-6 w-6" />,
|
||||
activeRegExp: /^\/blacklist/,
|
||||
activeRegExp: /^\/blocklist/,
|
||||
requiredPermission: [
|
||||
Permission.MANAGE_BLACKLIST,
|
||||
Permission.VIEW_BLACKLIST,
|
||||
Permission.MANAGE_BLOCKLIST,
|
||||
Permission.VIEW_BLOCKLIST,
|
||||
],
|
||||
permissionType: 'or',
|
||||
},
|
||||
|
||||
@@ -27,7 +27,7 @@ export const menuMessages = defineMessages('components.Layout.Sidebar', {
|
||||
browsemovies: 'Movies',
|
||||
browsetv: 'Series',
|
||||
requests: 'Requests',
|
||||
blacklist: 'Blacklist',
|
||||
blocklist: 'Blocklist',
|
||||
issues: 'Issues',
|
||||
users: 'Users',
|
||||
settings: 'Settings',
|
||||
@@ -79,13 +79,13 @@ const SidebarLinks: SidebarLinkProps[] = [
|
||||
activeRegExp: /^\/requests/,
|
||||
},
|
||||
{
|
||||
href: '/blacklist',
|
||||
messagesKey: 'blacklist',
|
||||
href: '/blocklist',
|
||||
messagesKey: 'blocklist',
|
||||
svgIcon: <EyeSlashIcon className="mr-3 h-6 w-6" />,
|
||||
activeRegExp: /^\/blacklist/,
|
||||
activeRegExp: /^\/blocklist/,
|
||||
requiredPermission: [
|
||||
Permission.MANAGE_BLACKLIST,
|
||||
Permission.VIEW_BLACKLIST,
|
||||
Permission.MANAGE_BLOCKLIST,
|
||||
Permission.VIEW_BLOCKLIST,
|
||||
],
|
||||
permissionType: 'or',
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import BlacklistBlock from '@app/components/BlacklistBlock';
|
||||
import BlocklistBlock from '@app/components/BlocklistBlock';
|
||||
import Button from '@app/components/Common/Button';
|
||||
import CachedImage from '@app/components/Common/CachedImage';
|
||||
import ConfirmButton from '@app/components/Common/ConfirmButton';
|
||||
@@ -314,13 +314,13 @@ const ManageSlideOver = ({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{data.mediaInfo?.status === MediaStatus.BLACKLISTED && (
|
||||
{data.mediaInfo?.status === MediaStatus.BLOCKLISTED && (
|
||||
<div>
|
||||
<h3 className="mb-2 text-xl font-bold">
|
||||
{intl.formatMessage(globalMessages.blacklist)}
|
||||
{intl.formatMessage(globalMessages.blocklist)}
|
||||
</h3>
|
||||
<div className="overflow-hidden rounded-md border border-gray-700 shadow">
|
||||
<BlacklistBlock
|
||||
<BlocklistBlock
|
||||
tmdbId={data.mediaInfo.tmdbId}
|
||||
onUpdate={() => revalidate()}
|
||||
onDelete={() => onClose()}
|
||||
@@ -651,7 +651,7 @@ const ManageSlideOver = ({
|
||||
)}
|
||||
{hasPermission(Permission.ADMIN) &&
|
||||
data?.mediaInfo &&
|
||||
data.mediaInfo.status !== MediaStatus.BLACKLISTED && (
|
||||
data.mediaInfo.status !== MediaStatus.BLOCKLISTED && (
|
||||
<div>
|
||||
<h3 className="mb-2 text-xl font-bold">
|
||||
{intl.formatMessage(messages.manageModalAdvanced)}
|
||||
|
||||
@@ -74,11 +74,11 @@ const MediaSlider = ({
|
||||
);
|
||||
}
|
||||
|
||||
if (settings.currentSettings.hideBlacklisted) {
|
||||
if (settings.currentSettings.hideBlocklisted) {
|
||||
titles = titles.filter(
|
||||
(i) =>
|
||||
(i.mediaType === 'movie' || i.mediaType === 'tv') &&
|
||||
i.mediaInfo?.status !== MediaStatus.BLACKLISTED
|
||||
i.mediaInfo?.status !== MediaStatus.BLOCKLISTED
|
||||
);
|
||||
}
|
||||
|
||||
@@ -102,18 +102,18 @@ const MediaSlider = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
const blacklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLACKLIST, Permission.VIEW_BLACKLIST],
|
||||
const blocklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLOCKLIST, Permission.VIEW_BLOCKLIST],
|
||||
{ type: 'or' }
|
||||
);
|
||||
|
||||
const finalTitles = titles
|
||||
.slice(0, 20)
|
||||
.filter((title) => {
|
||||
if (!blacklistVisibility)
|
||||
if (!blocklistVisibility)
|
||||
return (
|
||||
(title as TvResult | MovieResult).mediaInfo?.status !==
|
||||
MediaStatus.BLACKLISTED
|
||||
MediaStatus.BLOCKLISTED
|
||||
);
|
||||
return title;
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ import RTRotten from '@app/assets/rt_rotten.svg';
|
||||
import ImdbLogo from '@app/assets/services/imdb.svg';
|
||||
import Spinner from '@app/assets/spinner.svg';
|
||||
import TmdbLogo from '@app/assets/tmdb_logo.svg';
|
||||
import BlacklistModal from '@app/components/BlacklistModal';
|
||||
import BlocklistModal from '@app/components/BlocklistModal';
|
||||
import Button from '@app/components/Common/Button';
|
||||
import CachedImage from '@app/components/Common/CachedImage';
|
||||
import LoadingSpinner from '@app/components/Common/LoadingSpinner';
|
||||
@@ -128,9 +128,9 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
const [toggleWatchlist, setToggleWatchlist] = useState<boolean>(
|
||||
!movie?.onUserWatchlist
|
||||
);
|
||||
const [isBlacklistUpdating, setIsBlacklistUpdating] =
|
||||
const [isBlocklistUpdating, setIsBlocklistUpdating] =
|
||||
useState<boolean>(false);
|
||||
const [showBlacklistModal, setShowBlacklistModal] = useState(false);
|
||||
const [showBlocklistModal, setShowBlocklistModal] = useState(false);
|
||||
const { addToast } = useToasts();
|
||||
|
||||
const {
|
||||
@@ -161,8 +161,8 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
setShowManager(router.query.manage == '1' ? true : false);
|
||||
}, [router.query.manage]);
|
||||
|
||||
const closeBlacklistModal = useCallback(
|
||||
() => setShowBlacklistModal(false),
|
||||
const closeBlocklistModal = useCallback(
|
||||
() => setShowBlocklistModal(false),
|
||||
[]
|
||||
);
|
||||
|
||||
@@ -381,10 +381,10 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
};
|
||||
|
||||
const onClickHideItemBtn = async (): Promise<void> => {
|
||||
setIsBlacklistUpdating(true);
|
||||
setIsBlocklistUpdating(true);
|
||||
|
||||
try {
|
||||
await axios.post('/api/v1/blacklist', {
|
||||
await axios.post('/api/v1/blocklist', {
|
||||
tmdbId: movie?.id,
|
||||
mediaType: 'movie',
|
||||
title: movie?.title,
|
||||
@@ -393,7 +393,7 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.blacklistSuccess, {
|
||||
{intl.formatMessage(globalMessages.blocklistSuccess, {
|
||||
title: movie?.title,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -406,7 +406,7 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
if (e?.response?.status === 412) {
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.blacklistDuplicateError, {
|
||||
{intl.formatMessage(globalMessages.blocklistDuplicateError, {
|
||||
title: movie?.title,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -414,18 +414,18 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
{ appearance: 'info', autoDismiss: true }
|
||||
);
|
||||
} else {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setIsBlacklistUpdating(false);
|
||||
closeBlacklistModal();
|
||||
setIsBlocklistUpdating(false);
|
||||
closeBlocklistModal();
|
||||
};
|
||||
|
||||
const showHideButton = hasPermission([Permission.MANAGE_BLACKLIST], {
|
||||
const showHideButton = hasPermission([Permission.MANAGE_BLOCKLIST], {
|
||||
type: 'or',
|
||||
});
|
||||
|
||||
@@ -475,13 +475,13 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
revalidate={() => revalidate()}
|
||||
show={showManager}
|
||||
/>
|
||||
<BlacklistModal
|
||||
<BlocklistModal
|
||||
tmdbId={data.id}
|
||||
type="movie"
|
||||
show={showBlacklistModal}
|
||||
onCancel={closeBlacklistModal}
|
||||
show={showBlocklistModal}
|
||||
onCancel={closeBlocklistModal}
|
||||
onComplete={onClickHideItemBtn}
|
||||
isUpdating={isBlacklistUpdating}
|
||||
isUpdating={isBlocklistUpdating}
|
||||
/>
|
||||
<div className="media-header">
|
||||
<div className="media-poster">
|
||||
@@ -565,21 +565,21 @@ const MovieDetails = ({ movie }: MovieDetailsProps) => {
|
||||
data?.mediaInfo?.status !== MediaStatus.AVAILABLE &&
|
||||
data?.mediaInfo?.status !== MediaStatus.PARTIALLY_AVAILABLE &&
|
||||
data?.mediaInfo?.status !== MediaStatus.PENDING &&
|
||||
data?.mediaInfo?.status !== MediaStatus.BLACKLISTED && (
|
||||
data?.mediaInfo?.status !== MediaStatus.BLOCKLISTED && (
|
||||
<Tooltip
|
||||
content={intl.formatMessage(globalMessages.addToBlacklist)}
|
||||
content={intl.formatMessage(globalMessages.addToBlocklist)}
|
||||
>
|
||||
<Button
|
||||
buttonType={'ghost'}
|
||||
className="z-40 mr-2"
|
||||
buttonSize={'md'}
|
||||
onClick={() => setShowBlacklistModal(true)}
|
||||
onClick={() => setShowBlocklistModal(true)}
|
||||
>
|
||||
<EyeSlashIcon />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
{data?.mediaInfo?.status !== MediaStatus.BLACKLISTED &&
|
||||
{data?.mediaInfo?.status !== MediaStatus.BLOCKLISTED &&
|
||||
user?.userType !== UserType.PLEX && (
|
||||
<>
|
||||
{toggleWatchlist ? (
|
||||
|
||||
@@ -78,13 +78,13 @@ export const messages = defineMessages('components.PermissionEdit', {
|
||||
viewwatchlists: 'View {mediaServerName} Watchlists',
|
||||
viewwatchlistsDescription:
|
||||
"Grant permission to view other users' {mediaServerName} Watchlists.",
|
||||
manageblacklist: 'Manage Blacklist',
|
||||
manageblacklistDescription: 'Grant permission to manage blacklisted media.',
|
||||
blacklistedItems: 'Blacklist media.',
|
||||
blacklistedItemsDescription: 'Grant permission to blacklist media.',
|
||||
viewblacklistedItems: 'View blacklisted media.',
|
||||
viewblacklistedItemsDescription:
|
||||
'Grant permission to view blacklisted media.',
|
||||
manageblocklist: 'Manage Blocklist',
|
||||
manageblocklistDescription: 'Grant permission to manage blocklisted media.',
|
||||
blocklistedItems: 'Blocklist media.',
|
||||
blocklistedItemsDescription: 'Grant permission to blocklist media.',
|
||||
viewblocklistedItems: 'View blocklisted media.',
|
||||
viewblocklistedItemsDescription:
|
||||
'Grant permission to view blocklisted media.',
|
||||
});
|
||||
|
||||
interface PermissionEditProps {
|
||||
@@ -340,18 +340,18 @@ export const PermissionEdit = ({
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'manageblacklist',
|
||||
name: intl.formatMessage(messages.manageblacklist),
|
||||
description: intl.formatMessage(messages.manageblacklistDescription),
|
||||
permission: Permission.MANAGE_BLACKLIST,
|
||||
id: 'manageblocklist',
|
||||
name: intl.formatMessage(messages.manageblocklist),
|
||||
description: intl.formatMessage(messages.manageblocklistDescription),
|
||||
permission: Permission.MANAGE_BLOCKLIST,
|
||||
children: [
|
||||
{
|
||||
id: 'viewblacklisteditems',
|
||||
name: intl.formatMessage(messages.viewblacklistedItems),
|
||||
id: 'viewblocklisteditems',
|
||||
name: intl.formatMessage(messages.viewblocklistedItems),
|
||||
description: intl.formatMessage(
|
||||
messages.viewblacklistedItemsDescription
|
||||
messages.viewblocklistedItemsDescription
|
||||
),
|
||||
permission: Permission.VIEW_BLACKLIST,
|
||||
permission: Permission.VIEW_BLOCKLIST,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -298,7 +298,7 @@ const RequestButton = ({
|
||||
type: 'or',
|
||||
}) &&
|
||||
media &&
|
||||
media.status !== MediaStatus.BLACKLISTED &&
|
||||
media.status !== MediaStatus.BLOCKLISTED &&
|
||||
!isShowComplete
|
||||
) {
|
||||
buttons.push({
|
||||
@@ -345,7 +345,7 @@ const RequestButton = ({
|
||||
type: 'or',
|
||||
}) &&
|
||||
media &&
|
||||
media.status4k !== MediaStatus.BLACKLISTED &&
|
||||
media.status4k !== MediaStatus.BLOCKLISTED &&
|
||||
!is4kShowComplete &&
|
||||
settings.currentSettings.series4kEnabled
|
||||
) {
|
||||
|
||||
@@ -68,7 +68,7 @@ const CollectionRequestModal = ({
|
||||
|
||||
const getAllParts = (): number[] => {
|
||||
return (data?.parts ?? [])
|
||||
.filter((part) => part.mediaInfo?.status !== MediaStatus.BLACKLISTED)
|
||||
.filter((part) => part.mediaInfo?.status !== MediaStatus.BLOCKLISTED)
|
||||
.map((part) => part.id);
|
||||
};
|
||||
|
||||
@@ -257,8 +257,8 @@ const CollectionRequestModal = ({
|
||||
{ type: 'or' }
|
||||
);
|
||||
|
||||
const blacklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLACKLIST, Permission.VIEW_BLACKLIST],
|
||||
const blocklistVisibility = hasPermission(
|
||||
[Permission.MANAGE_BLOCKLIST, Permission.VIEW_BLOCKLIST],
|
||||
{ type: 'or' }
|
||||
);
|
||||
|
||||
@@ -360,9 +360,9 @@ const CollectionRequestModal = ({
|
||||
<tbody className="divide-y divide-gray-700">
|
||||
{data?.parts
|
||||
.filter((part) => {
|
||||
if (!blacklistVisibility)
|
||||
if (!blocklistVisibility)
|
||||
return (
|
||||
part.mediaInfo?.status !== MediaStatus.BLACKLISTED
|
||||
part.mediaInfo?.status !== MediaStatus.BLOCKLISTED
|
||||
);
|
||||
return part;
|
||||
})
|
||||
@@ -381,7 +381,7 @@ const CollectionRequestModal = ({
|
||||
<tr key={`part-${part.id}`}>
|
||||
<td
|
||||
className={`whitespace-nowrap px-4 py-4 text-sm font-medium leading-5 text-gray-100 ${
|
||||
partMedia?.status === MediaStatus.BLACKLISTED &&
|
||||
partMedia?.status === MediaStatus.BLOCKLISTED &&
|
||||
'pointer-events-none opacity-50'
|
||||
}`}
|
||||
>
|
||||
@@ -391,7 +391,7 @@ const CollectionRequestModal = ({
|
||||
aria-checked={
|
||||
(!!partMedia &&
|
||||
partMedia.status !==
|
||||
MediaStatus.BLACKLISTED) ||
|
||||
MediaStatus.BLOCKLISTED) ||
|
||||
isSelectedPart(part.id)
|
||||
}
|
||||
onClick={() => togglePart(part.id)}
|
||||
@@ -403,7 +403,7 @@ const CollectionRequestModal = ({
|
||||
className={`relative inline-flex h-5 w-10 flex-shrink-0 cursor-pointer items-center justify-center pt-2 focus:outline-none ${
|
||||
(!!partMedia &&
|
||||
partMedia.status !==
|
||||
MediaStatus.BLACKLISTED) ||
|
||||
MediaStatus.BLOCKLISTED) ||
|
||||
partRequest ||
|
||||
(quota?.movie.limit &&
|
||||
currentlyRemaining <= 0 &&
|
||||
@@ -417,7 +417,7 @@ const CollectionRequestModal = ({
|
||||
className={`${
|
||||
(!!partMedia &&
|
||||
partMedia.status !==
|
||||
MediaStatus.BLACKLISTED) ||
|
||||
MediaStatus.BLOCKLISTED) ||
|
||||
partRequest ||
|
||||
isSelectedPart(part.id)
|
||||
? 'bg-indigo-500'
|
||||
@@ -429,7 +429,7 @@ const CollectionRequestModal = ({
|
||||
className={`${
|
||||
(!!partMedia &&
|
||||
partMedia.status !==
|
||||
MediaStatus.BLACKLISTED) ||
|
||||
MediaStatus.BLOCKLISTED) ||
|
||||
partRequest ||
|
||||
isSelectedPart(part.id)
|
||||
? 'translate-x-5'
|
||||
@@ -440,7 +440,7 @@ const CollectionRequestModal = ({
|
||||
</td>
|
||||
<td
|
||||
className={`flex items-center px-1 py-4 text-sm font-medium leading-5 text-gray-100 md:px-6 ${
|
||||
partMedia?.status === MediaStatus.BLACKLISTED &&
|
||||
partMedia?.status === MediaStatus.BLOCKLISTED &&
|
||||
'pointer-events-none opacity-50'
|
||||
}`}
|
||||
>
|
||||
@@ -502,9 +502,9 @@ const CollectionRequestModal = ({
|
||||
{intl.formatMessage(globalMessages.available)}
|
||||
</Badge>
|
||||
)}
|
||||
{partMedia?.status === MediaStatus.BLACKLISTED && (
|
||||
{partMedia?.status === MediaStatus.BLOCKLISTED && (
|
||||
<Badge badgeType="danger">
|
||||
{intl.formatMessage(globalMessages.blacklisted)}
|
||||
{intl.formatMessage(globalMessages.blocklisted)}
|
||||
</Badge>
|
||||
)}
|
||||
</td>
|
||||
|
||||
@@ -34,7 +34,7 @@ const Search = () => {
|
||||
{
|
||||
query: router.query.query,
|
||||
},
|
||||
{ hideAvailable: false, hideBlacklisted: false }
|
||||
{ hideAvailable: false, hideBlocklisted: false }
|
||||
);
|
||||
|
||||
if (error) {
|
||||
|
||||
@@ -89,7 +89,7 @@ const messages: { [messageName: string]: MessageDescriptor } = defineMessages(
|
||||
'download-sync': 'Download Sync',
|
||||
'download-sync-reset': 'Download Sync Reset',
|
||||
'image-cache-cleanup': 'Image Cache Cleanup',
|
||||
'process-blacklisted-tags': 'Process Blacklisted Tags',
|
||||
'process-blocklisted-tags': 'Process Blocklisted Tags',
|
||||
editJobSchedule: 'Modify Job',
|
||||
jobScheduleEditSaved: 'Job edited successfully!',
|
||||
jobScheduleEditFailed: 'Something went wrong while saving the job.',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import BlacklistedTagsSelector from '@app/components/BlacklistedTagsSelector';
|
||||
import BlocklistedTagsSelector from '@app/components/BlocklistedTagsSelector';
|
||||
import Button from '@app/components/Common/Button';
|
||||
import LoadingSpinner from '@app/components/Common/LoadingSpinner';
|
||||
import PageTitle from '@app/components/Common/PageTitle';
|
||||
@@ -38,17 +38,17 @@ const messages = defineMessages('components.Settings.SettingsMain', {
|
||||
discoverRegionTip: 'Filter content by regional availability',
|
||||
originallanguage: 'Discover Language',
|
||||
originallanguageTip: 'Filter content by original language',
|
||||
blacklistedTags: 'Blacklist Content with Tags',
|
||||
blacklistedTagsTip:
|
||||
'Automatically add content with tags to the blacklist using the "Process Blacklisted Tags" job',
|
||||
blacklistedTagsLimit: 'Limit Content Blacklisted per Tag',
|
||||
blacklistedTagsLimitTip:
|
||||
'The "Process Blacklisted Tags" job will blacklist this many pages into each sort. Larger numbers will create a more accurate blacklist, but use more space.',
|
||||
blocklistedTags: 'Blocklist Content with Tags',
|
||||
blocklistedTagsTip:
|
||||
'Automatically add content with tags to the blocklist using the "Process Blocklisted Tags" job',
|
||||
blocklistedTagsLimit: 'Limit Content Blocklisted per Tag',
|
||||
blocklistedTagsLimitTip:
|
||||
'The "Process Blocklisted Tags" job will blocklist this many pages into each sort. Larger numbers will create a more accurate blocklist, but use more space.',
|
||||
streamingRegion: 'Streaming Region',
|
||||
streamingRegionTip: 'Show streaming sites by regional availability',
|
||||
hideBlacklisted: 'Hide Blacklisted Items',
|
||||
hideBlacklistedTip:
|
||||
'Hide blacklisted items from discover pages for all users with the "Manage Blacklist" permission',
|
||||
hideBlocklisted: 'Hide Blocklisted Items',
|
||||
hideBlocklistedTip:
|
||||
'Hide blocklisted items from discover pages for all users with the "Manage Blocklist" permission',
|
||||
toastApiKeySuccess: 'New API key generated successfully!',
|
||||
toastApiKeyFailure: 'Something went wrong while generating a new API key.',
|
||||
toastSettingsSuccess: 'Settings saved successfully!',
|
||||
@@ -101,7 +101,7 @@ const SettingsMain = () => {
|
||||
intl.formatMessage(messages.validationApplicationUrlTrailingSlash),
|
||||
(value) => !value || !value.endsWith('/')
|
||||
),
|
||||
blacklistedTagsLimit: Yup.number()
|
||||
blocklistedTagsLimit: Yup.number()
|
||||
.test(
|
||||
'positive',
|
||||
'Number must be greater than 0.',
|
||||
@@ -164,13 +164,13 @@ const SettingsMain = () => {
|
||||
applicationTitle: data?.applicationTitle,
|
||||
applicationUrl: data?.applicationUrl,
|
||||
hideAvailable: data?.hideAvailable,
|
||||
hideBlacklisted: data?.hideBlacklisted,
|
||||
hideBlocklisted: data?.hideBlocklisted,
|
||||
locale: data?.locale ?? 'en',
|
||||
discoverRegion: data?.discoverRegion,
|
||||
originalLanguage: data?.originalLanguage,
|
||||
streamingRegion: data?.streamingRegion || 'US',
|
||||
blacklistedTags: data?.blacklistedTags,
|
||||
blacklistedTagsLimit: data?.blacklistedTagsLimit || 50,
|
||||
blocklistedTags: data?.blocklistedTags,
|
||||
blocklistedTagsLimit: data?.blocklistedTagsLimit || 50,
|
||||
partialRequestsEnabled: data?.partialRequestsEnabled,
|
||||
enableSpecialEpisodes: data?.enableSpecialEpisodes,
|
||||
cacheImages: data?.cacheImages,
|
||||
@@ -184,13 +184,13 @@ const SettingsMain = () => {
|
||||
applicationTitle: values.applicationTitle,
|
||||
applicationUrl: values.applicationUrl,
|
||||
hideAvailable: values.hideAvailable,
|
||||
hideBlacklisted: values.hideBlacklisted,
|
||||
hideBlocklisted: values.hideBlocklisted,
|
||||
locale: values.locale,
|
||||
discoverRegion: values.discoverRegion,
|
||||
streamingRegion: values.streamingRegion,
|
||||
originalLanguage: values.originalLanguage,
|
||||
blacklistedTags: values.blacklistedTags,
|
||||
blacklistedTagsLimit: values.blacklistedTagsLimit,
|
||||
blocklistedTags: values.blocklistedTags,
|
||||
blocklistedTagsLimit: values.blocklistedTagsLimit,
|
||||
partialRequestsEnabled: values.partialRequestsEnabled,
|
||||
enableSpecialEpisodes: values.enableSpecialEpisodes,
|
||||
cacheImages: values.cacheImages,
|
||||
@@ -403,44 +403,44 @@ const SettingsMain = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="form-row">
|
||||
<label htmlFor="blacklistedTags" className="text-label">
|
||||
<span>{intl.formatMessage(messages.blacklistedTags)}</span>
|
||||
<label htmlFor="blocklistedTags" className="text-label">
|
||||
<span>{intl.formatMessage(messages.blocklistedTags)}</span>
|
||||
<span className="label-tip">
|
||||
{intl.formatMessage(messages.blacklistedTagsTip)}
|
||||
{intl.formatMessage(messages.blocklistedTagsTip)}
|
||||
</span>
|
||||
</label>
|
||||
<div className="form-input-area">
|
||||
<div className="form-input-field relative z-10">
|
||||
<BlacklistedTagsSelector
|
||||
defaultValue={values.blacklistedTags}
|
||||
<BlocklistedTagsSelector
|
||||
defaultValue={values.blocklistedTags}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="form-row">
|
||||
<label htmlFor="blacklistedTagsLimit" className="text-label">
|
||||
<label htmlFor="blocklistedTagsLimit" className="text-label">
|
||||
<span className="mr-2">
|
||||
{intl.formatMessage(messages.blacklistedTagsLimit)}
|
||||
{intl.formatMessage(messages.blocklistedTagsLimit)}
|
||||
</span>
|
||||
<SettingsBadge badgeType="advanced" />
|
||||
<span className="label-tip">
|
||||
{intl.formatMessage(messages.blacklistedTagsLimitTip)}
|
||||
{intl.formatMessage(messages.blocklistedTagsLimitTip)}
|
||||
</span>
|
||||
</label>
|
||||
<div className="form-input-area">
|
||||
<Field
|
||||
id="blacklistedTagsLimit"
|
||||
name="blacklistedTagsLimit"
|
||||
id="blocklistedTagsLimit"
|
||||
name="blocklistedTagsLimit"
|
||||
type="text"
|
||||
inputMode="numeric"
|
||||
className="short"
|
||||
placeholder={50}
|
||||
/>
|
||||
{errors.blacklistedTagsLimit &&
|
||||
touched.blacklistedTagsLimit &&
|
||||
typeof errors.blacklistedTagsLimit === 'string' && (
|
||||
{errors.blocklistedTagsLimit &&
|
||||
touched.blocklistedTagsLimit &&
|
||||
typeof errors.blocklistedTagsLimit === 'string' && (
|
||||
<div className="error">
|
||||
{errors.blacklistedTagsLimit}
|
||||
{errors.blocklistedTagsLimit}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -467,23 +467,23 @@ const SettingsMain = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="form-row">
|
||||
<label htmlFor="hideBlacklisted" className="checkbox-label">
|
||||
<label htmlFor="hideBlocklisted" className="checkbox-label">
|
||||
<span className="mr-2">
|
||||
{intl.formatMessage(messages.hideBlacklisted)}
|
||||
{intl.formatMessage(messages.hideBlocklisted)}
|
||||
</span>
|
||||
<span className="label-tip">
|
||||
{intl.formatMessage(messages.hideBlacklistedTip)}
|
||||
{intl.formatMessage(messages.hideBlocklistedTip)}
|
||||
</span>
|
||||
</label>
|
||||
<div className="form-input-area">
|
||||
<Field
|
||||
type="checkbox"
|
||||
id="hideBlacklisted"
|
||||
name="hideBlacklisted"
|
||||
id="hideBlocklisted"
|
||||
name="hideBlocklisted"
|
||||
onChange={() => {
|
||||
setFieldValue(
|
||||
'hideBlacklisted',
|
||||
!values.hideBlacklisted
|
||||
'hideBlocklisted',
|
||||
!values.hideBlocklisted
|
||||
);
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -19,7 +19,9 @@ const SetupSteps = ({
|
||||
<li className="relative md:flex md:flex-1">
|
||||
<div className="flex items-center space-x-4 px-6 py-4 text-sm font-medium leading-5">
|
||||
<div
|
||||
className={`flex h-10 w-10 flex-shrink-0 items-center justify-center border-2 ${active ? 'border-indigo-600' : 'border-white'} ${completed ? 'border-indigo-600 bg-indigo-600' : ''} rounded-full`}
|
||||
className={`flex h-10 w-10 flex-shrink-0 items-center justify-center border-2 ${
|
||||
active ? 'border-indigo-600' : 'border-white'
|
||||
} ${completed ? 'border-indigo-600 bg-indigo-600' : ''} rounded-full`}
|
||||
>
|
||||
{completed && <CheckIcon className="h-6 w-6 text-white" />}
|
||||
{!completed && (
|
||||
|
||||
@@ -362,12 +362,12 @@ const StatusBadge = ({
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
case MediaStatus.BLACKLISTED:
|
||||
case MediaStatus.BLOCKLISTED:
|
||||
return (
|
||||
<Tooltip content={mediaLinkDescription}>
|
||||
<Badge badgeType="danger" href={mediaLink}>
|
||||
{intl.formatMessage(is4k ? messages.status4k : messages.status, {
|
||||
status: intl.formatMessage(globalMessages.blacklisted),
|
||||
status: intl.formatMessage(globalMessages.blocklisted),
|
||||
})}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Spinner from '@app/assets/spinner.svg';
|
||||
import BlacklistModal from '@app/components/BlacklistModal';
|
||||
import BlocklistModal from '@app/components/BlocklistModal';
|
||||
import Button from '@app/components/Common/Button';
|
||||
import CachedImage from '@app/components/Common/CachedImage';
|
||||
import StatusBadgeMini from '@app/components/Common/StatusBadgeMini';
|
||||
@@ -78,7 +78,7 @@ const TitleCard = ({
|
||||
const { addToast } = useToasts();
|
||||
const [toggleWatchlist, setToggleWatchlist] =
|
||||
useState<boolean>(!isAddedToWatchlist);
|
||||
const [showBlacklistModal, setShowBlacklistModal] = useState(false);
|
||||
const [showBlocklistModal, setShowBlocklistModal] = useState(false);
|
||||
const cardRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
// Just to get the year from the date
|
||||
@@ -100,8 +100,8 @@ const TitleCard = ({
|
||||
[]
|
||||
);
|
||||
|
||||
const closeBlacklistModal = useCallback(
|
||||
() => setShowBlacklistModal(false),
|
||||
const closeBlocklistModal = useCallback(
|
||||
() => setShowBlocklistModal(false),
|
||||
[]
|
||||
);
|
||||
|
||||
@@ -173,7 +173,7 @@ const TitleCard = ({
|
||||
|
||||
if (topNode) {
|
||||
try {
|
||||
await axios.post('/api/v1/blacklist', {
|
||||
await axios.post('/api/v1/blocklist', {
|
||||
tmdbId: id,
|
||||
mediaType,
|
||||
title,
|
||||
@@ -181,19 +181,19 @@ const TitleCard = ({
|
||||
});
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.blacklistSuccess, {
|
||||
{intl.formatMessage(globalMessages.blocklistSuccess, {
|
||||
title,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
</span>,
|
||||
{ appearance: 'success', autoDismiss: true }
|
||||
);
|
||||
setCurrentStatus(MediaStatus.BLACKLISTED);
|
||||
setCurrentStatus(MediaStatus.BLOCKLISTED);
|
||||
} catch (e) {
|
||||
if (e?.response?.status === 412) {
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.blacklistDuplicateError, {
|
||||
{intl.formatMessage(globalMessages.blocklistDuplicateError, {
|
||||
title,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -201,7 +201,7 @@ const TitleCard = ({
|
||||
{ appearance: 'info', autoDismiss: true }
|
||||
);
|
||||
} else {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
@@ -209,26 +209,26 @@ const TitleCard = ({
|
||||
}
|
||||
|
||||
setIsUpdating(false);
|
||||
closeBlacklistModal();
|
||||
closeBlocklistModal();
|
||||
} else {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const onClickShowBlacklistBtn = async (): Promise<void> => {
|
||||
const onClickShowBlocklistBtn = async (): Promise<void> => {
|
||||
setIsUpdating(true);
|
||||
const topNode = cardRef.current;
|
||||
|
||||
if (topNode) {
|
||||
const res = await axios.delete('/api/v1/blacklist/' + id);
|
||||
const res = await axios.delete('/api/v1/blocklist/' + id);
|
||||
|
||||
if (res.status === 204) {
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.removeFromBlacklistSuccess, {
|
||||
{intl.formatMessage(globalMessages.removeFromBlocklistSuccess, {
|
||||
title,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -237,13 +237,13 @@ const TitleCard = ({
|
||||
);
|
||||
setCurrentStatus(MediaStatus.UNKNOWN);
|
||||
} else {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
@@ -264,7 +264,7 @@ const TitleCard = ({
|
||||
{ type: 'or' }
|
||||
);
|
||||
|
||||
const showHideButton = hasPermission([Permission.MANAGE_BLACKLIST], {
|
||||
const showHideButton = hasPermission([Permission.MANAGE_BLOCKLIST], {
|
||||
type: 'or',
|
||||
});
|
||||
|
||||
@@ -288,7 +288,7 @@ const TitleCard = ({
|
||||
onUpdating={requestUpdating}
|
||||
onCancel={closeModal}
|
||||
/>
|
||||
<BlacklistModal
|
||||
<BlocklistModal
|
||||
tmdbId={id}
|
||||
type={
|
||||
mediaType === 'movie'
|
||||
@@ -297,8 +297,8 @@ const TitleCard = ({
|
||||
? 'collection'
|
||||
: 'tv'
|
||||
}
|
||||
show={showBlacklistModal}
|
||||
onCancel={closeBlacklistModal}
|
||||
show={showBlocklistModal}
|
||||
onCancel={closeBlocklistModal}
|
||||
onComplete={onClickHideItemBtn}
|
||||
isUpdating={isUpdating}
|
||||
/>
|
||||
@@ -355,7 +355,7 @@ const TitleCard = ({
|
||||
: intl.formatMessage(globalMessages.tvshow)}
|
||||
</div>
|
||||
</div>
|
||||
{showDetail && currentStatus !== MediaStatus.BLACKLISTED && (
|
||||
{showDetail && currentStatus !== MediaStatus.BLOCKLISTED && (
|
||||
<div className="flex flex-col gap-1">
|
||||
{user?.userType !== UserType.PLEX &&
|
||||
(toggleWatchlist ? (
|
||||
@@ -385,7 +385,7 @@ const TitleCard = ({
|
||||
buttonType={'ghost'}
|
||||
className="z-40"
|
||||
buttonSize={'sm'}
|
||||
onClick={() => setShowBlacklistModal(true)}
|
||||
onClick={() => setShowBlocklistModal(true)}
|
||||
>
|
||||
<EyeSlashIcon className={'h-3'} />
|
||||
</Button>
|
||||
@@ -394,17 +394,17 @@ const TitleCard = ({
|
||||
)}
|
||||
{showDetail &&
|
||||
showHideButton &&
|
||||
currentStatus == MediaStatus.BLACKLISTED && (
|
||||
currentStatus == MediaStatus.BLOCKLISTED && (
|
||||
<Tooltip
|
||||
content={intl.formatMessage(
|
||||
globalMessages.removefromBlacklist
|
||||
globalMessages.removefromBlocklist
|
||||
)}
|
||||
>
|
||||
<Button
|
||||
buttonType={'ghost'}
|
||||
className="z-40"
|
||||
buttonSize={'sm'}
|
||||
onClick={() => onClickShowBlacklistBtn()}
|
||||
onClick={() => onClickShowBlocklistBtn()}
|
||||
>
|
||||
<EyeIcon className={'h-3'} />
|
||||
</Button>
|
||||
|
||||
@@ -4,7 +4,7 @@ import RTFresh from '@app/assets/rt_fresh.svg';
|
||||
import RTRotten from '@app/assets/rt_rotten.svg';
|
||||
import Spinner from '@app/assets/spinner.svg';
|
||||
import TmdbLogo from '@app/assets/tmdb_logo.svg';
|
||||
import BlacklistModal from '@app/components/BlacklistModal';
|
||||
import BlocklistModal from '@app/components/BlocklistModal';
|
||||
import Badge from '@app/components/Common/Badge';
|
||||
import Button from '@app/components/Common/Button';
|
||||
import CachedImage from '@app/components/Common/CachedImage';
|
||||
@@ -124,9 +124,9 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
const [toggleWatchlist, setToggleWatchlist] = useState<boolean>(
|
||||
!tv?.onUserWatchlist
|
||||
);
|
||||
const [isBlacklistUpdating, setIsBlacklistUpdating] =
|
||||
const [isBlocklistUpdating, setIsBlocklistUpdating] =
|
||||
useState<boolean>(false);
|
||||
const [showBlacklistModal, setShowBlacklistModal] = useState(false);
|
||||
const [showBlocklistModal, setShowBlocklistModal] = useState(false);
|
||||
const { addToast } = useToasts();
|
||||
|
||||
const {
|
||||
@@ -157,8 +157,8 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
setShowManager(router.query.manage == '1');
|
||||
}, [router.query.manage]);
|
||||
|
||||
const closeBlacklistModal = useCallback(
|
||||
() => setShowBlacklistModal(false),
|
||||
const closeBlocklistModal = useCallback(
|
||||
() => setShowBlocklistModal(false),
|
||||
[]
|
||||
);
|
||||
|
||||
@@ -411,10 +411,10 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
};
|
||||
|
||||
const onClickHideItemBtn = async (): Promise<void> => {
|
||||
setIsBlacklistUpdating(true);
|
||||
setIsBlocklistUpdating(true);
|
||||
|
||||
try {
|
||||
const res = await axios.post('/api/v1/blacklist', {
|
||||
const res = await axios.post('/api/v1/blocklist', {
|
||||
tmdbId: tv?.id,
|
||||
mediaType: 'tv',
|
||||
title: tv?.name,
|
||||
@@ -424,7 +424,7 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
if (res.status === 201) {
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.blacklistSuccess, {
|
||||
{intl.formatMessage(globalMessages.blocklistSuccess, {
|
||||
title: tv?.name,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -438,7 +438,7 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
if (e?.response?.status === 412) {
|
||||
addToast(
|
||||
<span>
|
||||
{intl.formatMessage(globalMessages.blacklistDuplicateError, {
|
||||
{intl.formatMessage(globalMessages.blocklistDuplicateError, {
|
||||
title: tv?.name,
|
||||
strong: (msg: React.ReactNode) => <strong>{msg}</strong>,
|
||||
})}
|
||||
@@ -446,18 +446,18 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
{ appearance: 'info', autoDismiss: true }
|
||||
);
|
||||
} else {
|
||||
addToast(intl.formatMessage(globalMessages.blacklistError), {
|
||||
addToast(intl.formatMessage(globalMessages.blocklistError), {
|
||||
appearance: 'error',
|
||||
autoDismiss: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setIsBlacklistUpdating(false);
|
||||
closeBlacklistModal();
|
||||
setIsBlocklistUpdating(false);
|
||||
closeBlocklistModal();
|
||||
};
|
||||
|
||||
const showHideButton = hasPermission([Permission.MANAGE_BLACKLIST], {
|
||||
const showHideButton = hasPermission([Permission.MANAGE_BLOCKLIST], {
|
||||
type: 'or',
|
||||
});
|
||||
|
||||
@@ -488,13 +488,13 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
</div>
|
||||
)}
|
||||
<PageTitle title={data.name} />
|
||||
<BlacklistModal
|
||||
<BlocklistModal
|
||||
tmdbId={data.id}
|
||||
type="tv"
|
||||
show={showBlacklistModal}
|
||||
onCancel={closeBlacklistModal}
|
||||
show={showBlocklistModal}
|
||||
onCancel={closeBlocklistModal}
|
||||
onComplete={onClickHideItemBtn}
|
||||
isUpdating={isBlacklistUpdating}
|
||||
isUpdating={isBlocklistUpdating}
|
||||
/>
|
||||
<IssueModal
|
||||
onCancel={() => setShowIssueModal(false)}
|
||||
@@ -607,21 +607,21 @@ const TvDetails = ({ tv }: TvDetailsProps) => {
|
||||
data?.mediaInfo?.status !== MediaStatus.AVAILABLE &&
|
||||
data?.mediaInfo?.status !== MediaStatus.PARTIALLY_AVAILABLE &&
|
||||
data?.mediaInfo?.status !== MediaStatus.PENDING &&
|
||||
data?.mediaInfo?.status !== MediaStatus.BLACKLISTED && (
|
||||
data?.mediaInfo?.status !== MediaStatus.BLOCKLISTED && (
|
||||
<Tooltip
|
||||
content={intl.formatMessage(globalMessages.addToBlacklist)}
|
||||
content={intl.formatMessage(globalMessages.addToBlocklist)}
|
||||
>
|
||||
<Button
|
||||
buttonType={'ghost'}
|
||||
className="z-40 mr-2"
|
||||
buttonSize={'md'}
|
||||
onClick={() => setShowBlacklistModal(true)}
|
||||
onClick={() => setShowBlocklistModal(true)}
|
||||
>
|
||||
<EyeSlashIcon />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
{data?.mediaInfo?.status !== MediaStatus.BLACKLISTED &&
|
||||
{data?.mediaInfo?.status !== MediaStatus.BLOCKLISTED &&
|
||||
user?.userType !== UserType.PLEX && (
|
||||
<>
|
||||
{toggleWatchlist ? (
|
||||
|
||||
Reference in New Issue
Block a user