Fix document output to better work with reality

This commit is contained in:
Bryan Ashby 2017-09-18 20:16:42 -06:00
parent 59826930e4
commit 985a14629a
1 changed files with 5 additions and 5 deletions

View File

@ -43,12 +43,12 @@ function documentFile(metadata) {
return; return;
} }
let desc = `${metadata.author||'Unknown Author'} - ${metadata.title||'Unknown'}`; let result = metadata.author || '';
const created = moment(metadata.createdate); if(result) {
if(created.isValid()) { result += ' - ';
desc += ` (${created.format('YYYY')})`;
} }
return desc; result += metadata.title || 'Unknown Title';
return result;
} }
function imageFile(metadata) { function imageFile(metadata) {