remove no-unused-vars from others too

This commit is contained in:
nikk gitanes
2021-06-06 20:37:02 +03:00
parent c03123fdc5
commit 4fdc6ddc5b
9 changed files with 8 additions and 15 deletions

View File

@@ -12,6 +12,7 @@ export default function AddDialogButton() {
const [isDialogOpen, setIsDialogOpen] = useState(false) const [isDialogOpen, setIsDialogOpen] = useState(false)
const handleClickOpen = () => setIsDialogOpen(true) const handleClickOpen = () => setIsDialogOpen(true)
const handleClose = () => setIsDialogOpen(false) const handleClose = () => setIsDialogOpen(false)
return ( return (
<div> <div>
<ListItem button key='Add' onClick={handleClickOpen}> <ListItem button key='Add' onClick={handleClickOpen}>

View File

@@ -10,9 +10,8 @@ const useStyles = makeStyles(theme => ({
})) }))
export default function DialogHeader({ title, onClose, onBack }) { export default function DialogHeader({ title, onClose, onBack }) {
const classes = useStyles()
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation() const { t } = useTranslation()
const classes = useStyles()
return ( return (
<AppBar className={classes.appBar}> <AppBar className={classes.appBar}>

View File

@@ -12,14 +12,13 @@ const { memo } = require('react')
const Table = memo( const Table = memo(
({ playableFileList, viewedFileList, selectedSeason, seasonAmount, hash }) => { ({ playableFileList, viewedFileList, selectedSeason, seasonAmount, hash }) => {
const { t } = useTranslation()
const preloadBuffer = fileId => fetch(`${streamHost()}?link=${hash}&index=${fileId}&preload`) const preloadBuffer = fileId => fetch(`${streamHost()}?link=${hash}&index=${fileId}&preload`)
const getFileLink = (path, id) => const getFileLink = (path, id) =>
`${streamHost()}/${encodeURIComponent(path.split('\\').pop().split('/').pop())}?link=${hash}&index=${id}&play` `${streamHost()}/${encodeURIComponent(path.split('\\').pop().split('/').pop())}?link=${hash}&index=${id}&play`
const fileHasEpisodeText = !!playableFileList?.find(({ path }) => ptt.parse(path).episode) const fileHasEpisodeText = !!playableFileList?.find(({ path }) => ptt.parse(path).episode)
const fileHasSeasonText = !!playableFileList?.find(({ path }) => ptt.parse(path).season) const fileHasSeasonText = !!playableFileList?.find(({ path }) => ptt.parse(path).season)
const fileHasResolutionText = !!playableFileList?.find(({ path }) => ptt.parse(path).resolution) const fileHasResolutionText = !!playableFileList?.find(({ path }) => ptt.parse(path).resolution)
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation()
return !playableFileList?.length ? ( return !playableFileList?.length ? (
'No playable files in this torrent' 'No playable files in this torrent'

View File

@@ -11,6 +11,7 @@ import { SectionSubName } from '../style'
const TorrentFunctions = memo( const TorrentFunctions = memo(
({ hash, viewedFileList, playableFileList, name, title, setViewedFileList }) => { ({ hash, viewedFileList, playableFileList, name, title, setViewedFileList }) => {
const { t } = useTranslation()
const latestViewedFileId = viewedFileList?.[viewedFileList?.length - 1] const latestViewedFileId = viewedFileList?.[viewedFileList?.length - 1]
const latestViewedFile = playableFileList?.find(({ id }) => id === latestViewedFileId)?.path const latestViewedFile = playableFileList?.find(({ id }) => id === latestViewedFileId)?.path
const isOnlyOnePlayableFile = playableFileList?.length === 1 const isOnlyOnePlayableFile = playableFileList?.length === 1
@@ -20,8 +21,6 @@ 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`
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation()
return ( return (
<> <>

View File

@@ -38,6 +38,7 @@ const Loader = () => (
) )
export default function DialogTorrentDetailsContent({ closeDialog, torrent }) { export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
const { t } = useTranslation()
const [isLoading, setIsLoading] = useState(true) const [isLoading, setIsLoading] = useState(true)
const [isDetailedCacheView, setIsDetailedCacheView] = useState(false) const [isDetailedCacheView, setIsDetailedCacheView] = useState(false)
const [viewedFileList, setViewedFileList] = useState() const [viewedFileList, setViewedFileList] = useState()
@@ -45,9 +46,6 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
const [seasonAmount, setSeasonAmount] = useState(null) const [seasonAmount, setSeasonAmount] = useState(null)
const [selectedSeason, setSelectedSeason] = useState() const [selectedSeason, setSelectedSeason] = useState()
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation()
const { const {
poster, poster,
hash, hash,

View File

@@ -12,8 +12,8 @@ const donateFrame =
'<iframe src="https://yoomoney.ru/quickpay/shop-widget?writer=seller&targets=TorrServer Donate&targets-hint=&default-sum=200&button-text=14&payment-type-choice=on&mobile-payment-type-choice=on&comment=on&hint=&successURL=&quickpay=shop&account=410013733697114" width="320" height="320" frameborder="0" allowtransparency="true" scrolling="no"></iframe>' '<iframe src="https://yoomoney.ru/quickpay/shop-widget?writer=seller&targets=TorrServer Donate&targets-hint=&default-sum=200&button-text=14&payment-type-choice=on&mobile-payment-type-choice=on&comment=on&hint=&successURL=&quickpay=shop&account=410013733697114" width="320" height="320" frameborder="0" allowtransparency="true" scrolling="no"></iframe>'
export default function DonateDialog({ onClose }) { export default function DonateDialog({ onClose }) {
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation() const { t } = useTranslation()
return ( return (
<Dialog open onClose={onClose} aria-labelledby='form-dialog-title' fullWidth> <Dialog open onClose={onClose} aria-labelledby='form-dialog-title' fullWidth>
<DialogTitle id='form-dialog-title'>{t('Donate')}</DialogTitle> <DialogTitle id='form-dialog-title'>{t('Donate')}</DialogTitle>

View File

@@ -32,11 +32,10 @@ const fnRemoveAll = () => {
} }
export default function RemoveAll() { export default function RemoveAll() {
const { t } = useTranslation()
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
const closeDialog = () => setOpen(false) const closeDialog = () => setOpen(false)
const openDialog = () => setOpen(true) const openDialog = () => setOpen(true)
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation()
return ( return (
<> <>
<ListItem button key={t('RemoveAll')} onClick={openDialog}> <ListItem button key={t('RemoveAll')} onClick={openDialog}>

View File

@@ -15,6 +15,7 @@ import { settingsHost, setTorrServerHost, getTorrServerHost } from 'utils/Hosts'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
export default function SettingsDialog() { export default function SettingsDialog() {
const { t } = useTranslation()
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
const [settings, setSets] = useState({}) const [settings, setSets] = useState({})
const [show, setShow] = useState(false) const [show, setShow] = useState(false)
@@ -28,8 +29,6 @@ export default function SettingsDialog() {
sets.CacheSize *= 1024 * 1024 sets.CacheSize *= 1024 * 1024
axios.post(settingsHost(), { action: 'set', sets }) axios.post(settingsHost(), { action: 'set', sets })
} }
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation()
useEffect(() => { useEffect(() => {
axios axios

View File

@@ -17,7 +17,6 @@ import { StyledButton, TorrentCard, TorrentCardButtons, TorrentCardDescription,
const Transition = forwardRef((props, ref) => <Slide direction='up' ref={ref} {...props} />) const Transition = forwardRef((props, ref) => <Slide direction='up' ref={ref} {...props} />)
export default function Torrent({ torrent }) { export default function Torrent({ torrent }) {
// eslint-disable-next-line no-unused-vars
const { t } = useTranslation() const { t } = useTranslation()
const [isDetailedInfoOpened, setIsDetailedInfoOpened] = useState(false) const [isDetailedInfoOpened, setIsDetailedInfoOpened] = useState(false)
const [isDeleteTorrentOpened, setIsDeleteTorrentOpened] = useState(false) const [isDeleteTorrentOpened, setIsDeleteTorrentOpened] = useState(false)