mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-03 21:29:59 -05:00
Using image next to a PDF with the same stem as the PDF's poster.
This commit is contained in:
parent
8cffea6e1f
commit
3f4d5798e2
4 changed files with 34 additions and 8 deletions
|
|
@ -674,6 +674,10 @@ export function findPosterPath(file) {
|
|||
// Ebook.
|
||||
return file['data']['cover_path'];
|
||||
}
|
||||
if (file['data'] && file['data']['poster_path']) {
|
||||
// PDF.
|
||||
return file['data']['poster_path'];
|
||||
}
|
||||
if (video && video['poster_path']) {
|
||||
// file is a video model.
|
||||
return video['poster_path'];
|
||||
|
|
|
|||
|
|
@ -144,22 +144,20 @@ function FileCard({file}) {
|
|||
}
|
||||
|
||||
const author = file.author;
|
||||
const downloadUrl = `/download/${encodeMediaPath(file.primary_path)}`;
|
||||
const color = mimetypeColor(file.mimetype);
|
||||
const size = file.size !== null && file.size !== undefined ? humanFileSize(file.size) : null;
|
||||
|
||||
const title = file.title || file.name || file.primary_path;
|
||||
const header = <ExternalCardLink to={downloadUrl} className='card-title-ellipsis'>
|
||||
{title}
|
||||
</ExternalCardLink>;
|
||||
const dt = file.published_datetime || file.published_modified_datetime || file.modified;
|
||||
return <Card color={color}>
|
||||
<CardPoster to={downloadUrl} file={file}/>
|
||||
<CardPoster file={file}/>
|
||||
<CardContent {...s}>
|
||||
<CardHeader>
|
||||
<Popup on='hover'
|
||||
trigger={header}
|
||||
content={title}/>
|
||||
<PreviewLink file={file}>
|
||||
<Popup on='hover'
|
||||
trigger={<span className='card-title-ellipsis'>{title}</span>}
|
||||
content={title}/>
|
||||
</PreviewLink>
|
||||
</CardHeader>
|
||||
{author && <b {...s}>{author}</b>}
|
||||
<p>{isoDatetimeToAgoPopup(dt, false)}</p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue