code refactoring / fix typos
This commit is contained in:
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.tsx linguist-detectable=false
|
||||
@@ -84,7 +84,7 @@ const LivestreamDialog: React.FC<Props> = ({ open, onClose }) => {
|
||||
<Grid item xs={12} mb={2}>
|
||||
<Alert severity="info">
|
||||
This will monitor yet to start livestream. Each process will be executed with --wait-for-video 10.<br />
|
||||
If an already started livestream is provided it will be still downloaded but progress will not be tracked.
|
||||
If an already started livestream is provided it will be still downloaded but its progress will not be tracked.
|
||||
</Alert>
|
||||
<Alert severity="warning" sx={{ mt: 1 }}>
|
||||
This feature is still experimental. Something might break!
|
||||
|
||||
@@ -66,60 +66,56 @@ const LiveStreamMonitorView: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<LivestreamSpeedDial onOpen={() => setOpenDialog(s => !s)} onStopAll={stopAll} />
|
||||
{
|
||||
!progress || Object.keys(progress).length === 0 ?
|
||||
<NoLivestreams /> :
|
||||
<Container maxWidth="xl" sx={{ mt: 4, mb: 8 }}>
|
||||
<Paper sx={{
|
||||
p: 2.5,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
minHeight: '80vh',
|
||||
}}>
|
||||
<TableContainer component={Box}>
|
||||
<Table sx={{ minWidth: '100%' }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Livestream URL</TableCell>
|
||||
<TableCell align="right">Status</TableCell>
|
||||
<TableCell align="right">Time to live</TableCell>
|
||||
<TableCell align="right">Starts on</TableCell>
|
||||
<TableCell align="right">Actions</TableCell>
|
||||
<LivestreamDialog open={openDialog} onClose={() => setOpenDialog(s => !s)} />
|
||||
|
||||
{!progress || Object.keys(progress).length === 0 ?
|
||||
<NoLivestreams /> :
|
||||
<Container maxWidth="xl" sx={{ mt: 4, mb: 8 }}>
|
||||
<Paper sx={{
|
||||
p: 2.5,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
minHeight: '80vh',
|
||||
}}>
|
||||
<TableContainer component={Box}>
|
||||
<Table sx={{ minWidth: '100%' }}>
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Livestream URL</TableCell>
|
||||
<TableCell align="right">Status</TableCell>
|
||||
<TableCell align="right">Time to live</TableCell>
|
||||
<TableCell align="right">Starts on</TableCell>
|
||||
<TableCell align="right">Actions</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{progress && Object.keys(progress).map(k => (
|
||||
<TableRow
|
||||
key={k}
|
||||
sx={{ '&:last-child td, &:last-child th': { border: 0 } }}
|
||||
>
|
||||
<TableCell>{k}</TableCell>
|
||||
<TableCell align='right'>
|
||||
{mapStatusToChip(progress[k].Status)}
|
||||
</TableCell>
|
||||
<TableCell align='right'>
|
||||
{formatMicro(Number(progress[k].WaitTime))}
|
||||
</TableCell>
|
||||
<TableCell align='right'>
|
||||
{new Date(progress[k].LiveDate).toLocaleString()}
|
||||
</TableCell>
|
||||
<TableCell align='right'>
|
||||
<Button variant='contained' size='small' onClick={() => stop(k)}>
|
||||
Stop
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{progress && Object.keys(progress).map(k => (
|
||||
<TableRow
|
||||
key={k}
|
||||
sx={{ '&:last-child td, &:last-child th': { border: 0 } }}
|
||||
>
|
||||
<TableCell>{k}</TableCell>
|
||||
<TableCell align='right'>
|
||||
{mapStatusToChip(progress[k].Status)}
|
||||
</TableCell>
|
||||
<TableCell align='right'>
|
||||
{formatMicro(Number(progress[k].WaitTime))}
|
||||
</TableCell>
|
||||
<TableCell align='right'>
|
||||
{new Date(progress[k].LiveDate).toLocaleString()}
|
||||
</TableCell>
|
||||
<TableCell align='right'>
|
||||
<Button variant='contained' size='small' onClick={() => stop(k)}>
|
||||
Stop
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Paper>
|
||||
</Container>
|
||||
}
|
||||
<LivestreamDialog
|
||||
open={openDialog}
|
||||
onClose={() => setOpenDialog(s => !s)}
|
||||
/>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Paper>
|
||||
</Container>}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ func (l *LiveStream) monitorStartTime(r io.Reader) error {
|
||||
|
||||
l.liveDate = parsed
|
||||
|
||||
//TODO: check if useing channels is stupid or not
|
||||
//TODO: check if using channels is stupid or not
|
||||
// l.waitTimeChan <- time.Until(start)
|
||||
l.waitTime = time.Until(parsed)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user