2022-11-30 19:31:18 -07:00
|
|
|
import React, {Fragment, useContext, useEffect, useState} from 'react';
|
2022-08-06 05:22:07 +00:00
|
|
|
import {Link, Route, Routes, useParams} from "react-router-dom";
|
|
|
|
|
import {
|
2022-11-04 09:58:38 -06:00
|
|
|
CardLink,
|
2022-12-19 10:58:45 -07:00
|
|
|
CardPosterLink, cardTitleWrapper,
|
2021-11-01 16:42:52 -06:00
|
|
|
defaultSearchOrder,
|
|
|
|
|
defaultVideoOrder,
|
2022-11-04 09:58:38 -06:00
|
|
|
Duration,
|
2022-12-23 16:04:09 -07:00
|
|
|
isoDatetimeToString,
|
2022-11-04 09:58:38 -06:00
|
|
|
FileIcon,
|
|
|
|
|
isEmpty,
|
|
|
|
|
mimetypeColor,
|
2022-01-31 16:52:22 -07:00
|
|
|
PageContainer,
|
2021-11-01 16:42:52 -06:00
|
|
|
scrollToTop,
|
2022-08-06 05:22:07 +00:00
|
|
|
SearchInput,
|
2022-01-29 22:25:35 -07:00
|
|
|
TabLinks,
|
2022-11-04 09:58:38 -06:00
|
|
|
textEllipsis,
|
2022-10-24 15:17:48 -06:00
|
|
|
useTitle
|
2021-11-01 16:42:52 -06:00
|
|
|
} from "./Common"
|
|
|
|
|
import VideoPage from "./VideoPlayer";
|
2022-11-04 09:58:38 -06:00
|
|
|
import {
|
2022-11-30 20:13:54 -07:00
|
|
|
CardContent,
|
|
|
|
|
CardDescription,
|
|
|
|
|
CardHeader,
|
2022-11-04 09:58:38 -06:00
|
|
|
Confirm,
|
|
|
|
|
Container,
|
|
|
|
|
Dropdown,
|
|
|
|
|
Image,
|
|
|
|
|
PlaceholderHeader,
|
|
|
|
|
PlaceholderLine,
|
|
|
|
|
StatisticLabel,
|
|
|
|
|
StatisticValue,
|
|
|
|
|
TableCell
|
|
|
|
|
} from "semantic-ui-react";
|
2021-11-01 16:42:52 -06:00
|
|
|
import {Channels, EditChannel, NewChannel} from "./Channels";
|
2022-08-06 05:22:07 +00:00
|
|
|
import {useChannel, useQuery, useSearchVideos, useVideo, useVideoStatistics} from "../hooks/customHooks";
|
|
|
|
|
import {FilesView} from "./Files";
|
|
|
|
|
import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
|
|
|
|
|
import Icon from "semantic-ui-react/dist/commonjs/elements/Icon";
|
2022-11-30 20:13:54 -07:00
|
|
|
import {Button, Card, CardIcon, Header, Loader, Placeholder, Segment, Statistic, StatisticGroup} from "./Theme";
|
2022-09-23 16:43:45 -06:00
|
|
|
import {deleteVideos} from "../api";
|
2022-11-04 09:58:38 -06:00
|
|
|
import {ThemeContext} from "../contexts/contexts";
|
2022-08-06 05:22:07 +00:00
|
|
|
|
|
|
|
|
export function VideoWrapper() {
|
|
|
|
|
const {videoId} = useParams();
|
2022-09-28 09:38:05 -06:00
|
|
|
const {videoFile, prevFile, nextFile, setFavorite} = useVideo(videoId);
|
2022-10-28 08:12:25 -06:00
|
|
|
|
|
|
|
|
// Scroll to the top when videoId changes.
|
|
|
|
|
useEffect(scrollToTop, [videoId]);
|
2022-08-06 05:22:07 +00:00
|
|
|
|
2022-09-28 09:38:05 -06:00
|
|
|
return <VideoPage videoFile={videoFile} prevFile={prevFile} nextFile={nextFile}
|
|
|
|
|
setFavorite={setFavorite} autoplay={true}/>
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-11-30 19:31:18 -07:00
|
|
|
function VideosPage({filter}) {
|
2022-10-25 15:57:44 -06:00
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
const {channelId} = useParams();
|
|
|
|
|
const {searchParams, updateQuery} = useQuery();
|
2022-09-23 16:43:45 -06:00
|
|
|
const [selectedVideos, setSelectedVideos] = useState([]);
|
|
|
|
|
const [deleteOpen, setDeleteOpen] = useState(false);
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
let searchOrder = defaultVideoOrder;
|
|
|
|
|
if (searchParams.get('order')) {
|
|
|
|
|
// Use whatever order the user specified.
|
|
|
|
|
searchOrder = searchParams.get('order');
|
|
|
|
|
} else if (searchParams.get('q')) {
|
|
|
|
|
// User used a search_str
|
|
|
|
|
searchOrder = defaultSearchOrder;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
let filtersEnabled = searchParams.getAll('filter');
|
|
|
|
|
filtersEnabled = filter ? [...filtersEnabled, filter] : filtersEnabled;
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2022-09-23 16:43:45 -06:00
|
|
|
const {searchStr, setSearchStr, videos, activePage, setPage, limit, setLimit, totalPages, setOrderBy, fetchVideos} =
|
2022-08-06 05:22:07 +00:00
|
|
|
useSearchVideos(null, channelId, searchOrder, filtersEnabled);
|
|
|
|
|
const setView = (value) => updateQuery({view: value});
|
|
|
|
|
const view = searchParams.get('view');
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
const {channel} = useChannel(channelId);
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2022-12-01 09:54:37 -07:00
|
|
|
let title = 'Videos';
|
|
|
|
|
if (filter && filter.indexOf('favorite') >= 0) {
|
|
|
|
|
title = 'Favorite Videos';
|
|
|
|
|
}
|
|
|
|
|
if (channel && channel.name) {
|
|
|
|
|
title = `${channel.name} Videos`;
|
|
|
|
|
}
|
|
|
|
|
useTitle(title);
|
|
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
const filterOptions = [
|
|
|
|
|
{text: 'Favorites', key: 'favorite', value: 'favorite'},
|
|
|
|
|
{text: 'Censored', key: 'censored', value: 'censored'},
|
|
|
|
|
];
|
|
|
|
|
const setFilters = (value) => updateQuery({filter: value});
|
|
|
|
|
|
2022-10-24 15:17:48 -06:00
|
|
|
let videoOrders = [
|
|
|
|
|
{key: '-upload_date', value: '-upload_date', text: 'Newest'},
|
|
|
|
|
{key: 'upload_date', value: 'upload_date', text: 'Oldest'},
|
|
|
|
|
{key: '-duration', value: '-duration', text: 'Longest'},
|
|
|
|
|
{key: 'duration', value: 'duration', text: 'Shortest'},
|
|
|
|
|
{key: '-viewed', value: '-viewed', text: 'Recently viewed'},
|
|
|
|
|
{key: '-size', value: '-size', text: 'Largest'},
|
|
|
|
|
{key: 'size', value: 'size', text: 'Smallest'},
|
|
|
|
|
{key: '-view_count', value: '-view_count', text: 'Most Views'},
|
|
|
|
|
{key: 'view_count', value: 'view_count', text: 'Least Views'},
|
|
|
|
|
{key: '-modification_datetime', value: '-modification_datetime', text: 'Newest File'},
|
|
|
|
|
{key: 'modification_datetime', value: 'modification_datetime', text: 'Oldest File'},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
if (searchStr) {
|
|
|
|
|
videoOrders = [{key: 'rank', value: 'rank', text: 'Search Rank'}, ...videoOrders];
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-30 19:31:18 -07:00
|
|
|
const menuColumns = <Fragment>
|
2022-08-06 05:22:07 +00:00
|
|
|
<Grid.Column mobile={8} computer={5}>
|
|
|
|
|
<SearchInput clearable searchStr={searchStr} onSubmit={setSearchStr} actionIcon='search'/>
|
|
|
|
|
</Grid.Column>
|
|
|
|
|
<Grid.Column mobile={6} computer={5}>
|
|
|
|
|
<Dropdown selection fluid
|
|
|
|
|
size='large'
|
|
|
|
|
placeholder='Sort by...'
|
|
|
|
|
value={searchOrder}
|
|
|
|
|
options={videoOrders}
|
|
|
|
|
onChange={(e, {value}) => setOrderBy(value)}
|
|
|
|
|
/>
|
|
|
|
|
</Grid.Column>
|
2022-11-30 19:31:18 -07:00
|
|
|
</Fragment>;
|
2022-08-06 05:22:07 +00:00
|
|
|
|
|
|
|
|
let header;
|
|
|
|
|
if (channel && channel.name) {
|
|
|
|
|
const editLink = `/videos/channel/${channelId}/edit`;
|
|
|
|
|
header = <>
|
|
|
|
|
<Header as='h1'>
|
|
|
|
|
{channel.name}
|
|
|
|
|
<Link to={editLink}>
|
|
|
|
|
<Icon name='edit' style={{marginLeft: '0.5em'}}/>
|
|
|
|
|
</Link>
|
|
|
|
|
</Header>
|
|
|
|
|
</>;
|
|
|
|
|
} else if (channelId) {
|
|
|
|
|
header = <Placeholder style={{marginBottom: '1em'}}>
|
|
|
|
|
<PlaceholderHeader>
|
|
|
|
|
<PlaceholderLine/>
|
|
|
|
|
</PlaceholderHeader>
|
|
|
|
|
</Placeholder>;
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-09-23 16:43:45 -06:00
|
|
|
const onSelect = (path, checked) => {
|
2022-10-24 17:15:15 -06:00
|
|
|
if (checked && path) {
|
|
|
|
|
setSelectedVideos([...selectedVideos, path]);
|
|
|
|
|
} else if (path) {
|
|
|
|
|
setSelectedVideos(selectedVideos.filter(i => i !== path));
|
2022-09-23 16:43:45 -06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onDelete = async (e) => {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
setDeleteOpen(false);
|
2022-10-24 17:15:15 -06:00
|
|
|
const videoIds = videos.filter(i => selectedVideos.indexOf(i['path']) >= 0).map(i => i['video']['id']);
|
|
|
|
|
await deleteVideos(videoIds);
|
2022-09-23 16:43:45 -06:00
|
|
|
await fetchVideos();
|
|
|
|
|
setSelectedVideos([]);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-24 17:15:15 -06:00
|
|
|
const invertSelection = async () => {
|
|
|
|
|
const newSelectedVideos = videos.map(video => video['key']).filter(i => selectedVideos.indexOf(i) < 0);
|
|
|
|
|
setSelectedVideos(newSelectedVideos);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const clearSelection = async (e) => {
|
|
|
|
|
if (e) e.preventDefault();
|
|
|
|
|
setSelectedVideos([]);
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-23 16:43:45 -06:00
|
|
|
const selectElm = <div style={{marginTop: '0.5em'}}>
|
|
|
|
|
<Button
|
|
|
|
|
color='red'
|
2022-11-04 09:58:38 -06:00
|
|
|
disabled={isEmpty(selectedVideos)}
|
2022-09-23 16:43:45 -06:00
|
|
|
onClick={() => setDeleteOpen(true)}
|
|
|
|
|
>Delete</Button>
|
|
|
|
|
<Confirm
|
|
|
|
|
open={deleteOpen}
|
|
|
|
|
content='Are you sure you want to delete these video files? This cannot be undone.'
|
|
|
|
|
confirmButton='Delete'
|
|
|
|
|
onCancel={() => setDeleteOpen(false)}
|
|
|
|
|
onConfirm={onDelete}
|
|
|
|
|
/>
|
2022-10-24 17:15:15 -06:00
|
|
|
<Button
|
|
|
|
|
color='grey'
|
|
|
|
|
onClick={() => invertSelection()}
|
2022-11-04 09:58:38 -06:00
|
|
|
disabled={isEmpty(videos)}
|
2022-10-24 17:15:15 -06:00
|
|
|
>
|
|
|
|
|
Invert
|
|
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
color='yellow'
|
|
|
|
|
onClick={() => clearSelection()}
|
2022-11-04 09:58:38 -06:00
|
|
|
disabled={isEmpty(videos) || isEmpty(selectedVideos)}
|
2022-10-24 17:15:15 -06:00
|
|
|
>
|
|
|
|
|
Clear
|
|
|
|
|
</Button>
|
2022-09-23 16:43:45 -06:00
|
|
|
</div>;
|
|
|
|
|
|
2022-01-03 15:13:02 -07:00
|
|
|
return <>
|
2022-08-06 05:22:07 +00:00
|
|
|
{header}
|
|
|
|
|
<FilesView
|
|
|
|
|
files={videos}
|
|
|
|
|
view={view}
|
|
|
|
|
limit={limit}
|
|
|
|
|
activePage={activePage}
|
|
|
|
|
totalPages={totalPages}
|
|
|
|
|
showView={true}
|
|
|
|
|
showLimit={true}
|
|
|
|
|
showSelect={true}
|
2022-09-23 16:43:45 -06:00
|
|
|
onSelect={onSelect}
|
2022-10-24 17:15:15 -06:00
|
|
|
selectedKeys={selectedVideos}
|
2022-09-23 16:43:45 -06:00
|
|
|
selectElem={selectElm}
|
2022-08-06 05:22:07 +00:00
|
|
|
setView={setView}
|
|
|
|
|
setLimit={setLimit}
|
|
|
|
|
setPage={setPage}
|
|
|
|
|
filterOptions={filterOptions}
|
|
|
|
|
activeFilters={filtersEnabled}
|
|
|
|
|
setFilters={setFilters}
|
|
|
|
|
multipleFilters={true}
|
|
|
|
|
menuColumnsCount={3}
|
|
|
|
|
menuColumns={menuColumns}
|
|
|
|
|
>
|
|
|
|
|
</FilesView>
|
2022-01-03 15:13:02 -07:00
|
|
|
</>
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
function Statistics() {
|
2022-10-25 15:57:44 -06:00
|
|
|
useTitle('Video Statistics');
|
|
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
const {statistics} = useVideoStatistics();
|
|
|
|
|
const {videos, historical, channels} = statistics;
|
2021-12-23 09:38:12 -07:00
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
if (!videos) {
|
|
|
|
|
return <Loader active inline='centered'/>
|
2021-12-23 09:38:12 -07:00
|
|
|
}
|
|
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
const videoNames = [
|
2022-10-19 09:18:53 -06:00
|
|
|
{key: 'videos', label: 'Videos'},
|
2022-08-06 05:22:07 +00:00
|
|
|
{key: 'favorites', label: 'Favorite Videos'},
|
|
|
|
|
{key: 'sum_size', label: 'Total Size'},
|
|
|
|
|
{key: 'max_size', label: 'Largest Video'},
|
|
|
|
|
{key: 'week', label: 'Downloads Past Week'},
|
|
|
|
|
{key: 'month', label: 'Downloads Past Month'},
|
|
|
|
|
{key: 'year', label: 'Downloads Past Year'},
|
|
|
|
|
{key: 'sum_duration', label: 'Total Duration'},
|
|
|
|
|
];
|
|
|
|
|
const historicalNames = [
|
|
|
|
|
{key: 'average_count', label: 'Average Monthly Downloads'},
|
|
|
|
|
{key: 'average_size', label: 'Average Monthly Usage'},
|
|
|
|
|
];
|
|
|
|
|
const channelNames = [
|
|
|
|
|
{key: 'channels', label: 'Channels'},
|
|
|
|
|
];
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2022-08-06 05:22:07 +00:00
|
|
|
const buildSegment = (title, names, stats) => {
|
|
|
|
|
return <Segment>
|
|
|
|
|
<Header textAlign='center' as='h1'>{title}</Header>
|
|
|
|
|
<StatisticGroup>
|
|
|
|
|
{names.map(
|
|
|
|
|
({key, label}) =>
|
|
|
|
|
<Statistic key={key} style={{margin: '2em'}}>
|
|
|
|
|
<StatisticValue>{stats[key]}</StatisticValue>
|
|
|
|
|
<StatisticLabel>{label}</StatisticLabel>
|
|
|
|
|
</Statistic>
|
|
|
|
|
)}
|
|
|
|
|
</StatisticGroup>
|
|
|
|
|
</Segment>
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-01-29 22:25:35 -07:00
|
|
|
return (
|
2022-08-06 05:22:07 +00:00
|
|
|
<>
|
|
|
|
|
{buildSegment('Videos', videoNames, videos)}
|
|
|
|
|
{buildSegment('Historical Video', historicalNames, historical)}
|
|
|
|
|
{buildSegment('Channels', channelNames, channels)}
|
|
|
|
|
</>
|
2022-01-29 22:25:35 -07:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function VideosRoute(props) {
|
|
|
|
|
const links = [
|
2022-08-06 05:22:07 +00:00
|
|
|
{text: 'Videos', to: '/videos', key: 'videos', end: true},
|
2022-02-02 14:02:51 -07:00
|
|
|
{text: 'Favorites', to: '/videos/favorites', key: 'favorites'},
|
|
|
|
|
{text: 'Channels', to: '/videos/channel', key: 'channel'},
|
2022-08-06 05:22:07 +00:00
|
|
|
{text: 'Statistics', to: '/videos/statistics', key: 'statistics'},
|
2022-01-29 22:25:35 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return (
|
2022-01-31 09:32:06 -07:00
|
|
|
<PageContainer>
|
2022-01-29 22:25:35 -07:00
|
|
|
<TabLinks links={links}/>
|
2022-08-06 05:22:07 +00:00
|
|
|
<Routes>
|
2022-11-30 19:31:18 -07:00
|
|
|
<Route path='/' exact element={<VideosPage/>}/>
|
|
|
|
|
<Route path='favorites' exact element={<VideosPage filter='favorite' header='Favorite Videos'/>}/>
|
2022-08-06 05:22:07 +00:00
|
|
|
<Route path='channel' exact element={<Channels/>}/>
|
|
|
|
|
<Route path='statistics' exact element={<Statistics/>}/>
|
|
|
|
|
<Route path='channel/new' exact element={<NewChannel/>}/>
|
|
|
|
|
<Route path='channel/:channelId/edit' exact element={<EditChannel/>}/>
|
2022-11-30 19:31:18 -07:00
|
|
|
<Route path='channel/:channelId/video' exact element={<VideosPage/>}/>
|
2022-08-06 05:22:07 +00:00
|
|
|
</Routes>
|
2022-01-31 09:32:06 -07:00
|
|
|
</PageContainer>
|
2022-01-29 22:25:35 -07:00
|
|
|
)
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
2022-11-04 09:58:38 -06:00
|
|
|
export function VideoCard({file}) {
|
|
|
|
|
const {video} = file;
|
|
|
|
|
const {s} = useContext(ThemeContext);
|
|
|
|
|
|
|
|
|
|
let video_url = `/videos/video/${video.id}`;
|
2022-12-23 16:04:09 -07:00
|
|
|
const upload_date = isoDatetimeToString(video.upload_date);
|
2022-11-04 09:58:38 -06:00
|
|
|
// A video may not have a channel.
|
|
|
|
|
const channel = video.channel ? video.channel : null;
|
|
|
|
|
let channel_url = null;
|
|
|
|
|
if (channel) {
|
|
|
|
|
channel_url = `/videos/channel/${channel.id}/video`;
|
|
|
|
|
video_url = `/videos/channel/${channel.id}/video/${video.id}`;
|
|
|
|
|
}
|
|
|
|
|
const poster_url = video.poster_path ? `/media/${encodeURIComponent(video.poster_path)}` : null;
|
|
|
|
|
|
|
|
|
|
let imageLabel = null;
|
|
|
|
|
if (video.favorite) {
|
|
|
|
|
imageLabel = {corner: 'left', icon: 'heart', color: 'green'};
|
|
|
|
|
}
|
2022-11-08 22:42:00 -07:00
|
|
|
let poster = <Link to={video_url}><CardIcon><FileIcon file={file}/></CardIcon></Link>;
|
2022-11-04 09:58:38 -06:00
|
|
|
if (poster_url) {
|
2022-11-08 22:42:00 -07:00
|
|
|
poster = <CardPosterLink to={video_url} poster_url={poster_url} imageLabel={imageLabel}/>;
|
2022-11-04 09:58:38 -06:00
|
|
|
}
|
|
|
|
|
|
2022-11-30 20:13:54 -07:00
|
|
|
const color = mimetypeColor(file.mimetype);
|
|
|
|
|
return <Card color={color}>
|
2022-11-08 22:42:00 -07:00
|
|
|
{poster}
|
2022-11-04 09:58:38 -06:00
|
|
|
<Duration video={video}/>
|
2022-11-30 20:13:54 -07:00
|
|
|
<CardContent {...s}>
|
|
|
|
|
<CardHeader>
|
2022-11-04 09:58:38 -06:00
|
|
|
<Container textAlign='left'>
|
|
|
|
|
<Link to={video_url} className="no-link-underscore card-link">
|
2022-12-19 10:58:45 -07:00
|
|
|
<p {...s}>{cardTitleWrapper(video.title || video.stem || video.video_path)}</p>
|
2022-11-04 09:58:38 -06:00
|
|
|
</Link>
|
|
|
|
|
</Container>
|
2022-11-30 20:13:54 -07:00
|
|
|
</CardHeader>
|
|
|
|
|
<CardDescription>
|
2022-11-04 09:58:38 -06:00
|
|
|
<Container textAlign='left'>
|
|
|
|
|
{channel && <Link to={channel_url} className="no-link-underscore card-link">
|
|
|
|
|
<b {...s}>{channel.name}</b>
|
|
|
|
|
</Link>}
|
|
|
|
|
<p {...s}>{upload_date}</p>
|
|
|
|
|
</Container>
|
2022-11-30 20:13:54 -07:00
|
|
|
</CardDescription>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2022-11-04 09:58:38 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function VideoRowCells({file}) {
|
|
|
|
|
const {video} = file;
|
|
|
|
|
|
|
|
|
|
let video_url = `/videos/video/${video.id}`;
|
|
|
|
|
const poster_url = video.poster_path ? `/media/${encodeURIComponent(video.poster_path)}` : null;
|
|
|
|
|
|
|
|
|
|
let poster;
|
|
|
|
|
let imageLabel = video.favorite ? {corner: 'left', icon: 'heart', color: 'green'} : null;
|
|
|
|
|
if (poster_url) {
|
|
|
|
|
poster = <CardLink to={video_url}>
|
|
|
|
|
<Image wrapped
|
|
|
|
|
src={poster_url}
|
|
|
|
|
label={imageLabel}
|
|
|
|
|
width='50px'
|
|
|
|
|
/>
|
|
|
|
|
</CardLink>
|
|
|
|
|
} else {
|
|
|
|
|
poster = <FileIcon file={file} size='large'/>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Fragment for SelectableRow
|
|
|
|
|
return <React.Fragment>
|
|
|
|
|
<TableCell>
|
|
|
|
|
<center>
|
|
|
|
|
{poster}
|
|
|
|
|
</center>
|
|
|
|
|
</TableCell>
|
|
|
|
|
<TableCell>
|
|
|
|
|
<CardLink to={video_url}>
|
2022-12-19 10:58:45 -07:00
|
|
|
{textEllipsis(video.title || video.stem || video.video_path)}
|
2022-11-04 09:58:38 -06:00
|
|
|
</CardLink>
|
|
|
|
|
</TableCell>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
}
|