diff --git a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx index 1ae46b4..81e3ef0 100644 --- a/web/src/components/DialogTorrentDetailsContent/Table/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/Table/index.jsx @@ -10,6 +10,11 @@ import { TableStyle, ShortTableWrapper, ShortTable } from './style' const { memo } = require('react') +// russian episode detection support +ptt.addHandler('episode', /(\d{1,4})[- |. ]серия|серия[- |. ](\d{1,4})/i, { type: 'integer' }) +ptt.addHandler('season', /sezon[- |. ](\d{1,3})|(\d{1,3})[- |. ]sezon/i, { type: 'integer' }) +ptt.addHandler('season', /сезон[- |. ](\d{1,3})|(\d{1,3})[- |. ]сезон/i, { type: 'integer' }) + const Table = memo( ({ playableFileList, viewedFileList, selectedSeason, seasonAmount, hash }) => { const { t } = useTranslation() @@ -20,6 +25,9 @@ const Table = memo( const fileHasSeasonText = !!playableFileList?.find(({ path }) => ptt.parse(path).season) const fileHasResolutionText = !!playableFileList?.find(({ path }) => ptt.parse(path).resolution) + // if files in list is more then 1 and no season text detected by ptt.parse, show full name + const shouldDisplayFullFileName = playableFileList.length > 1 && !fileHasEpisodeText + return !playableFileList?.length ? ( 'No playable files in this torrent' ) : ( @@ -47,7 +55,7 @@ const Table = memo( (season === selectedSeason || !seasonAmount?.length) && ( - {title} + {shouldDisplayFullFileName ? path : title} {fileHasSeasonText && seasonAmount?.length === 1 && {season}} {fileHasEpisodeText && {episode}} {fileHasResolutionText && {resolution}}