VLC button is showing only in standalone apps now. Not in mobile browser. Default state is false for VLC setting

This commit is contained in:
Daniel Shleifman
2022-09-14 21:13:38 +03:00
parent d052077201
commit 803b59a291
2 changed files with 5 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import { streamHost } from 'utils/Hosts'
import isEqual from 'lodash/isEqual'
import { humanizeSize } from 'utils/Utils'
import { humanizeSize, isStandaloneApp } from 'utils/Utils'
import ptt from 'parse-torrent-title'
import { Button } from '@material-ui/core'
import CopyToClipboard from 'react-copy-to-clipboard'
@@ -28,12 +28,13 @@ 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
const isVlcUsed = JSON.parse(localStorage.getItem('isVlcUsed')) ?? false
return !playableFileList?.length ? (
'No playable files in this torrent'
) : (
<>
<div>{isVlcUsed.toString()}</div>
<TableStyle>
<thead>
<tr>
@@ -135,7 +136,7 @@ const Table = memo(
{t('Preload')}
</Button>
{isVlcUsed ? (
{isVlcUsed && isStandaloneApp ? (
<a style={{ textDecoration: 'none' }} href={`vlc://${link}`}>
<Button style={{ width: '100%' }} variant='outlined' color='primary' size='small'>
VLC

View File

@@ -32,7 +32,7 @@ export default function SettingsDialog({ handleClose }) {
const [cachePercentage, setCachePercentage] = useState(40)
const [preloadCachePercentage, setPreloadCachePercentage] = useState(0)
const [isProMode, setIsProMode] = useState(JSON.parse(localStorage.getItem('isProMode')) || false)
const [isVlcUsed, setIsVlcUsed] = useState(JSON.parse(localStorage.getItem('isVlcUsed')) ?? true)
const [isVlcUsed, setIsVlcUsed] = useState(JSON.parse(localStorage.getItem('isVlcUsed')) ?? false)
useEffect(() => {
axios.post(settingsHost(), { action: 'get' }).then(({ data }) => {