mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
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:
@@ -1,6 +1,6 @@
|
|||||||
import { streamHost } from 'utils/Hosts'
|
import { streamHost } from 'utils/Hosts'
|
||||||
import isEqual from 'lodash/isEqual'
|
import isEqual from 'lodash/isEqual'
|
||||||
import { humanizeSize } from 'utils/Utils'
|
import { humanizeSize, isStandaloneApp } from 'utils/Utils'
|
||||||
import ptt from 'parse-torrent-title'
|
import ptt from 'parse-torrent-title'
|
||||||
import { Button } from '@material-ui/core'
|
import { Button } from '@material-ui/core'
|
||||||
import CopyToClipboard from 'react-copy-to-clipboard'
|
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
|
// 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 shouldDisplayFullFileName = playableFileList?.length > 1 && !fileHasEpisodeText
|
||||||
|
|
||||||
const isVlcUsed = JSON.parse(localStorage.getItem('isVlcUsed')) ?? true
|
const isVlcUsed = JSON.parse(localStorage.getItem('isVlcUsed')) ?? false
|
||||||
|
|
||||||
return !playableFileList?.length ? (
|
return !playableFileList?.length ? (
|
||||||
'No playable files in this torrent'
|
'No playable files in this torrent'
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
|
<div>{isVlcUsed.toString()}</div>
|
||||||
<TableStyle>
|
<TableStyle>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -135,7 +136,7 @@ const Table = memo(
|
|||||||
{t('Preload')}
|
{t('Preload')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{isVlcUsed ? (
|
{isVlcUsed && isStandaloneApp ? (
|
||||||
<a style={{ textDecoration: 'none' }} href={`vlc://${link}`}>
|
<a style={{ textDecoration: 'none' }} href={`vlc://${link}`}>
|
||||||
<Button style={{ width: '100%' }} variant='outlined' color='primary' size='small'>
|
<Button style={{ width: '100%' }} variant='outlined' color='primary' size='small'>
|
||||||
VLC
|
VLC
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ export default function SettingsDialog({ handleClose }) {
|
|||||||
const [cachePercentage, setCachePercentage] = useState(40)
|
const [cachePercentage, setCachePercentage] = useState(40)
|
||||||
const [preloadCachePercentage, setPreloadCachePercentage] = useState(0)
|
const [preloadCachePercentage, setPreloadCachePercentage] = useState(0)
|
||||||
const [isProMode, setIsProMode] = useState(JSON.parse(localStorage.getItem('isProMode')) || false)
|
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(() => {
|
useEffect(() => {
|
||||||
axios.post(settingsHost(), { action: 'get' }).then(({ data }) => {
|
axios.post(settingsHost(), { action: 'get' }).then(({ data }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user