change hash to magnet link

This commit is contained in:
nikk gitanes
2023-09-03 10:13:31 +03:00
parent 3463464902
commit 240680dfa7

View File

@@ -21,6 +21,7 @@ const TorrentFunctions = memo(
axios.post(viewedHost(), { action: 'rem', hash, file_index: -1 }).then(() => setViewedFileList()) axios.post(viewedHost(), { action: 'rem', hash, file_index: -1 }).then(() => setViewedFileList())
const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(name || title || 'file')}.m3u?link=${hash}&m3u` const fullPlaylistLink = `${playlistTorrHost()}/${encodeURIComponent(name || title || 'file')}.m3u?link=${hash}&m3u`
const partialPlaylistLink = `${fullPlaylistLink}&fromlast` const partialPlaylistLink = `${fullPlaylistLink}&fromlast`
const magnet = `magnet:?xt=urn:btih:${hash}&dn=${encodeURIComponent(name || title)}`
return ( return (
<> <>
@@ -73,7 +74,7 @@ const TorrentFunctions = memo(
</Button> </Button>
</a> </a>
)} )}
<CopyToClipboard text={hash}> <CopyToClipboard text={magnet}>
<Button variant='contained' color='primary' size='large'> <Button variant='contained' color='primary' size='large'>
{t('CopyHash')} {t('CopyHash')}
</Button> </Button>