Displaying video file's title in table row.

This commit is contained in:
Roland 2023-04-09 14:52:44 -06:00
parent 0b0e6346a7
commit 977f85aebc
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
3 changed files with 13 additions and 16 deletions

View file

@ -25,6 +25,7 @@ import {
FileIcon,
findPosterPath,
HelpHeader,
humanFileSize,
isoDatetimeToString,
mimetypeColor,
PageContainer,
@ -70,7 +71,7 @@ function ArchivePage() {
</>
}
const {data} = archiveFile;
const {data, size} = archiveFile;
const singlefileUrl = data.singlefile_path ? `/media/${encodeMediaPath(data.singlefile_path)}` : null;
const screenshotUrl = data.screenshot_path ? `/media/${encodeMediaPath(data.screenshot_path)}` : null;
@ -167,6 +168,7 @@ function ArchivePage() {
<Header as='h3'>{isoDatetimeToString(data.archive_datetime)}</Header>
{domainHeader}
{urlHeader}
<Header as='h5'>{humanFileSize(size)}</Header>
{singlefileButton}
{readabilityLink}
@ -452,6 +454,7 @@ function Archives() {
actionIcon='search'
searchStr={searchStr}
onSubmit={setSearchStr}
placeholder='Search Archives...'
/>;
return <>

View file

@ -208,10 +208,6 @@ const secondsToYears = 31536000;
const secondsToDays = 86400;
const secondsToHours = 3600;
const secondsToMinutes = 60;
const msToYears = secondsToYears * 1000;
const msToDays = secondsToDays * 1000;
const msToHours = secondsToHours * 1000;
const msToMinutes = secondsToMinutes * 1000;
export function secondsToFullDuration(seconds) {
let s = '';
@ -235,11 +231,6 @@ export function secondsToFullDuration(seconds) {
return s;
}
export function secondsToDate(seconds) {
let date = new Date(seconds * 1000);
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
}
export function secondsToTimestamp(seconds) {
let d = new Date(seconds * 1000);
const month = String(d.getMonth() + 1).padStart(2, '0');

View file

@ -178,7 +178,12 @@ function VideosPage() {
setPage,
);
const searchInput = <SearchInput clearable searchStr={searchStr} onSubmit={setSearchStr} actionIcon='search'/>;
const searchInput = <SearchInput clearable
searchStr={searchStr}
onSubmit={setSearchStr}
actionIcon='search'
placeholder='Search Videos...'
/>;
return <>
{header}
@ -203,10 +208,8 @@ function VideosPage() {
<Grid.Column width={1}>{viewButton}</Grid.Column>
<Grid.Column width={2}>{limitDropdown}</Grid.Column>
<Grid.Column width={1}>{tagQuerySelector}</Grid.Column>
<Grid.Column width={5}><SortButton sorts={videoOrders}/></Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column width={8}>{searchInput}</Grid.Column>
<Grid.Column width={4}><SortButton sorts={videoOrders}/></Grid.Column>
<Grid.Column width={7}>{searchInput}</Grid.Column>
</Grid.Row>
</Grid>
</Media>
@ -353,7 +356,7 @@ export function VideoRowCells({file}) {
<TableCell>
<CardLink to={video_url}>
<FileRowTagIcon file={file}/>
{textEllipsis(video.title || video.stem || video.video_path)}
{textEllipsis(file.title || video.stem || video.video_path)}
</CardLink>
</TableCell>
</React.Fragment>