diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx
index dc88def..e3936ad 100644
--- a/web/src/components/TorrentCard/index.jsx
+++ b/web/src/components/TorrentCard/index.jsx
@@ -1,5 +1,6 @@
import 'fontsource-roboto'
import { forwardRef, memo, useState } from 'react'
+import ptt from 'parse-torrent-title'
import {
UnfoldMore as UnfoldMoreIcon,
Edit as EditIcon,
@@ -14,9 +15,9 @@ import Dialog from '@material-ui/core/Dialog'
import Slide from '@material-ui/core/Slide'
import { Button, DialogActions, DialogTitle, useMediaQuery, useTheme } from '@material-ui/core'
import axios from 'axios'
-import ptt from 'parse-torrent-title'
import { useTranslation } from 'react-i18next'
import AddDialog from 'components/Add/AddDialog'
+import { isFilePlayable } from 'components/DialogTorrentDetailsContent/helpers'
import { StyledButton, TorrentCard, TorrentCardButtons, TorrentCardDescription, TorrentCardPoster } from './style'
@@ -40,7 +41,19 @@ const Torrent = ({ torrent }) => {
const dropTorrent = () => axios.post(torrentsHost(), { action: 'drop', hash })
const deleteTorrent = () => axios.post(torrentsHost(), { action: 'rem', hash })
- const parsedTitle = (title || name) && ptt.parse(title || name).title
+ const getParsedData = () => {
+ const parse = key => ptt.parse(title || '')?.[key] || ptt.parse(name || '')?.[key]
+
+ const parsedYear = parse('year')
+ const parsedResolution = parse('resolution')
+ const parsedTitle = parse('title')
+
+ return { parsedResolution, parsedYear, parsedTitle }
+ }
+
+ const { parsedResolution, parsedYear, parsedTitle } = getParsedData()
+
+ const playableFileAmount = torrent.file_stats?.filter(({ path }) => isFilePlayable(path))?.length
const [isEditDialogOpen, setIsEditDialogOpen] = useState(false)
const handleClickOpenEditDialog = () => setIsEditDialogOpen(true)
@@ -81,6 +94,29 @@ const Torrent = ({ torrent }) => {
{shortenText(parsedTitle, 100)}
+
+ {parsedResolution && (
+
+
{t('Resolution')}
+
{parsedResolution}
+
+ )}
+
+ {parsedYear && (
+
+
{t('Year')}
+
{parsedYear}
+
+ )}
+
+ {playableFileAmount > 1 && (
+
+
{t('Files')}
+
{playableFileAmount}
+
+ )}
+
+
{t('Size')}
diff --git a/web/src/components/TorrentCard/style.js b/web/src/components/TorrentCard/style.js
index eb696bb..419fe95 100644
--- a/web/src/components/TorrentCard/style.js
+++ b/web/src/components/TorrentCard/style.js
@@ -17,12 +17,12 @@ export const TorrentCard = styled.div`
'buttons buttons';
grid-template-columns: 70px 1fr;
- grid-template-rows: 110px max-content;
+ grid-template-rows: 130px max-content;
}
@media (max-width: 770px) {
grid-template-columns: 60px 1fr;
- grid-template-rows: 90px max-content;
+ grid-template-rows: 110px max-content;
}
`
@@ -79,16 +79,20 @@ export const TorrentCardDescription = styled.div`
border-radius: 5px;
padding: 5px;
display: grid;
- grid-template-rows: 55% 1fr;
+ grid-template-rows: 40% 1fr 1fr;
gap: 10px;
+ @media (max-width: 1260px) {
+ grid-template-rows: max-content 1fr 1fr;
+ }
+
@media (max-width: 770px) {
- grid-template-rows: 60% 1fr;
+ grid-template-rows: 35% 1fr 1fr;
gap: 3px;
}
@media (max-width: 770px) {
- grid-template-rows: 56% 1fr;
+ /* grid-template-rows: 56% 1fr; */
}
.description-title-wrapper {
diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json
index e156036..c4465db 100644
--- a/web/src/locales/en/translation.json
+++ b/web/src/locales/en/translation.json
@@ -47,6 +47,7 @@
"EditTorrent": "Edit torrent",
"EnableIPv6": "IPv6",
"Episode": "Episode",
+ "Files": "Files",
"ForceEncrypt": "Force Encrypt Headers",
"FromLatestFile": "From Latest File",
"Full": "Full",
@@ -112,5 +113,6 @@
"UseDiskDesc": "Better use external media on flash-based devices",
"UTP": "μTP (Micro Transport Protocol)",
"Viewed": "Viewed",
- "WrongTorrentSource": "Wrong torrent source"
+ "WrongTorrentSource": "Wrong torrent source",
+ "Year": "Year"
}
\ No newline at end of file
diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json
index 25218f9..427d44c 100644
--- a/web/src/locales/ru/translation.json
+++ b/web/src/locales/ru/translation.json
@@ -47,6 +47,7 @@
"EditTorrent": "Изменить торрент",
"EnableIPv6": "IPv6",
"Episode": "Серия",
+ "Files": "Файлы",
"ForceEncrypt": "Принудительное шифрование заголовков",
"FromLatestFile": "C последнего файла",
"Full": "Полный",
@@ -112,5 +113,6 @@
"UseDiskDesc": "Рекомендуется использовать внешние носители на устройствах с flash-памятью",
"UTP": "μTP (Micro Transport Protocol)",
"Viewed": "Просм.",
- "WrongTorrentSource": "Неправильный torrent-источник"
+ "WrongTorrentSource": "Неправильный torrent-источник",
+ "Year": "Год"
}
\ No newline at end of file