mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 10:51:36 -04:00
Handling if data is empty in FileCard.
This commit is contained in:
parent
f439e411b6
commit
f3e2c0d7e8
2 changed files with 6 additions and 3 deletions
|
|
@ -139,7 +139,10 @@ function FileCard({file}) {
|
|||
}
|
||||
|
||||
const {data} = file;
|
||||
const {author} = data;
|
||||
let author;
|
||||
if (data) {
|
||||
author = data['author'];
|
||||
}
|
||||
const downloadUrl = `/download/${encodeURIComponent(file.primary_path)}`;
|
||||
const color = mimetypeColor(file.mimetype);
|
||||
const size = file.size !== null && file.size !== undefined ? humanFileSize(file.size) : null;
|
||||
|
|
@ -153,7 +156,7 @@ function FileCard({file}) {
|
|||
<CardContent {...s}>
|
||||
<CardHeader>
|
||||
<ExternalCardLink to={downloadUrl}>
|
||||
{cardTitleWrapper(file.title || file.stem || file.primary_path)}
|
||||
{cardTitleWrapper(file.title || file.name || file.primary_path)}
|
||||
</ExternalCardLink>
|
||||
</CardHeader>
|
||||
{author && <b {...s}>{author}</b>}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ def get_video_for_app(video_id: int) -> Tuple[dict, Optional[dict], Optional[dic
|
|||
|
||||
VIDEO_ORDERS = {
|
||||
'upload_date': 'v.upload_date ASC, LOWER(fg.primary_path) ASC',
|
||||
'-upload_date': 'v.upload_date DESC NULLS LAST, LOWER(fg.primary_path) DESC',
|
||||
'-upload_date': 'v.upload_date DESC NULLS LAST, LOWER(fg.primary_path) ASC',
|
||||
'rank': '2 DESC, LOWER(fg.primary_path) DESC',
|
||||
'-rank': '2 ASC, LOWER(fg.primary_path) ASC',
|
||||
'id': 'fg.id ASC',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue