VLC button support added

This commit is contained in:
Daniel Shleifman
2022-06-19 20:12:39 +03:00
parent 619949d25c
commit a0ba83c9d4
7 changed files with 63 additions and 12 deletions

View File

@@ -28,6 +28,8 @@ const Table = memo(
// 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
const isVlcUsed = JSON.parse(localStorage.getItem('isVlcUsed')) ?? true
return !playableFileList?.length ? (
'No playable files in this torrent'
) : (
@@ -133,11 +135,19 @@ const Table = memo(
{t('Preload')}
</Button>
<a style={{ textDecoration: 'none' }} href={link} target='_blank' rel='noreferrer'>
<Button style={{ width: '100%' }} variant='outlined' color='primary' size='small'>
{t('OpenLink')}
</Button>
</a>
{isVlcUsed ? (
<a style={{ textDecoration: 'none' }} href={`vlc://${link}`}>
<Button style={{ width: '100%' }} variant='outlined' color='primary' size='small'>
VLC
</Button>
</a>
) : (
<a style={{ textDecoration: 'none' }} href={link} target='_blank' rel='noreferrer'>
<Button style={{ width: '100%' }} variant='outlined' color='primary' size='small'>
{t('OpenLink')}
</Button>
</a>
)}
<CopyToClipboard text={link}>
<Button variant='outlined' color='primary' size='small'>