diff --git a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx index 637d340..9502623 100644 --- a/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/widgets/index.jsx @@ -11,6 +11,7 @@ import { import { getPeerString, humanizeSize, humanizeSpeed } from 'utils/Utils' import { useTranslation } from 'react-i18next' import { GETTING_INFO, IN_DB, CLOSED, PRELOAD, WORKING } from 'torrentStates' +import { TORRENT_CATEGORIES } from 'components/categories' import StatisticsField from '../StatisticsField' import useGetWidgetColors from './useGetWidgetColors' @@ -131,12 +132,15 @@ export const SizeWidget = ({ data }) => { export const CategoryWidget = ({ data }) => { const { t } = useTranslation() const { iconBGColor, valueBGColor } = useGetWidgetColors('category') + // main categories + const catIndex = TORRENT_CATEGORIES.findIndex(e => e.key === data) + const catArray = TORRENT_CATEGORIES.find(e => e.key === data) if (data) { return ( = 0 ? t(catArray.name) : data} iconBg={iconBGColor} valueBg={valueBGColor} icon={CategoryIcon} diff --git a/web/src/components/FilterByCategory.jsx b/web/src/components/FilterByCategory.jsx index 64afd10..8c817e8 100644 --- a/web/src/components/FilterByCategory.jsx +++ b/web/src/components/FilterByCategory.jsx @@ -6,10 +6,10 @@ import { useTranslation } from 'react-i18next' export default function FilterByCategory({ categoryKey, categoryName, setGlobalFilterCategory, icon }) { const onClick = () => { setGlobalFilterCategory(categoryKey) - if (process.env.NODE_ENV !== 'production') { + // if (process.env.NODE_ENV !== 'production') { // eslint-disable-next-line no-console - console.log('FilterByCategory categoryKey: %s categoryName: %s', categoryKey, categoryName) - } + // console.log('FilterByCategory categoryKey: %s categoryName: %s', categoryKey, categoryName) + // } } const { t } = useTranslation() diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index d1117d1..125290a 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -82,7 +82,7 @@ const Torrent = ({ torrent }) => { const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(parsedTitle || 'file')}.m3u?link=${hash}&m3u` const detailedInfoDialogRef = useOnStandaloneAppOutsideClick(closeDetailedInfo) - // FIXME + // main categories const catIndex = TORRENT_CATEGORIES.findIndex(e => e.key === category) const catArray = TORRENT_CATEGORIES.find(e => e.key === category) @@ -123,9 +123,7 @@ const Torrent = ({ torrent }) => {
{t('Name')} -
- {catIndex >= 0 ? t(catArray.name) : '' /* {category} */} -
+
{catIndex >= 0 ? t(catArray.name) : category}
{parsedTitle}