diff --git a/web/src/components/TorrentCard/index.jsx b/web/src/components/TorrentCard/index.jsx index f533a6b..97044da 100644 --- a/web/src/components/TorrentCard/index.jsx +++ b/web/src/components/TorrentCard/index.jsx @@ -1,12 +1,12 @@ import { forwardRef, memo, useState } from 'react' import { UnfoldMore as UnfoldMoreIcon, - Edit as EditIcon, + PlayArrow as PlayArrowIcon, Close as CloseIcon, Delete as DeleteIcon, } from '@material-ui/icons' import { getPeerString, humanizeSize, humanizeSpeed, removeRedundantCharacters } from 'utils/Utils' -import { torrentsHost } from 'utils/Hosts' +import { playlistTorrHost, torrentsHost } from 'utils/Hosts' import { NoImageIcon } from 'icons' import DialogTorrentDetailsContent from 'components/DialogTorrentDetailsContent' import Dialog from '@material-ui/core/Dialog' @@ -59,10 +59,12 @@ const Torrent = ({ torrent }) => { const handleClickOpenEditDialog = () => setIsEditDialogOpen(true) const handleCloseEditDialog = () => setIsEditDialogOpen(false) + const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(parsedTitle || 'file')}.m3u?link=${hash}&m3u` + return ( <> - + {poster ? poster : } @@ -72,9 +74,13 @@ const Torrent = ({ torrent }) => { {t('Details')} - - - {t('Edit')} + { + window.open(fullPlaylistLink, '_blank') + }} + > + + {t('Playlist')} dropTorrent(torrent)}> diff --git a/web/src/components/TorrentCard/style.js b/web/src/components/TorrentCard/style.js index bbc4eb7..5c14d06 100644 --- a/web/src/components/TorrentCard/style.js +++ b/web/src/components/TorrentCard/style.js @@ -37,6 +37,7 @@ export const TorrentCardPoster = styled.div` border-radius: 5px; overflow: hidden; text-align: center; + cursor: pointer; ${({ isPoster, diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json index 96cce51..9be6afc 100644 --- a/web/src/locales/en/translation.json +++ b/web/src/locales/en/translation.json @@ -71,6 +71,7 @@ "Peers": "Peers", "PiecesCount": "Pieces count", "PiecesLength": "Pieces length", + "Playlist": "Playlist", "Preload": "Preload", "ProjectSource": "Project page", "Releases": "TorrServer Releases", diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json index 14bd608..cbcb007 100644 --- a/web/src/locales/ru/translation.json +++ b/web/src/locales/ru/translation.json @@ -71,6 +71,7 @@ "Peers": "Пиры", "PiecesCount": "Кол-во блоков", "PiecesLength": "Размер блока", + "Playlist": "Плейлист", "Preload": "Предзагр.", "ProjectSource": "Сайт проекта", "Releases": "Релизы TorrServer",