From 1736f8a2d026a4978ff757039c6adc48efda6700 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Wed, 16 Jun 2021 04:50:52 +0300 Subject: [PATCH] swap details and format --- .../components/DialogTorrentDetailsContent/index.jsx | 12 ++++++------ web/src/utils/Utils.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/web/src/components/DialogTorrentDetailsContent/index.jsx b/web/src/components/DialogTorrentDetailsContent/index.jsx index f111305..158ac23 100644 --- a/web/src/components/DialogTorrentDetailsContent/index.jsx +++ b/web/src/components/DialogTorrentDetailsContent/index.jsx @@ -110,10 +110,10 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { newNameStrings.push(title) } else if (torrentParsedName?.title) newNameStrings.push(torrentParsedName?.title) - if (torrentParsedName?.year) newNameStrings.push(torrentParsedName?.year) - if (torrentParsedName?.resolution) newNameStrings.push(torrentParsedName?.resolution) + // if (torrentParsedName?.year) newNameStrings.push(torrentParsedName?.year) + // if (torrentParsedName?.resolution) newNameStrings.push(torrentParsedName?.resolution) - return newNameStrings.join('. ') + return newNameStrings.join(' ') } return ( @@ -146,11 +146,11 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
{title && name !== title ? ( <> - {shortenText(getParsedTitle(), 55)} - {shortenText(ptt.parse(name).title, 110)} + {ptt.parse(name).title} + {getParsedTitle()} ) : ( - {shortenText(getParsedTitle(), 55)} + {getParsedTitle()} )} diff --git a/web/src/utils/Utils.js b/web/src/utils/Utils.js index 06289f7..1e1bac5 100644 --- a/web/src/utils/Utils.js +++ b/web/src/utils/Utils.js @@ -1,7 +1,7 @@ export function humanizeSize(size) { if (!size) return '' const i = Math.floor(Math.log(size) / Math.log(1024)) - return `${(size / Math.pow(1024, i)).toFixed(2) * 1} ${['B', 'kB', 'MB', 'GB', 'TB'][i]}` + return `${(size / Math.pow(1024, i)).toFixed(2) * 1} ${['B', 'KB', 'MB', 'GB', 'TB'][i]}` } export function getPeerString(torrent) { @@ -10,4 +10,4 @@ export function getPeerString(torrent) { } export const shortenText = (text, sympolAmount) => - text ? text.slice(0, sympolAmount) + (text.length > sympolAmount ? '...' : '') : '' + text ? text.slice(0, sympolAmount) + (text.length > sympolAmount ? '…' : '') : ''