Улучшение отображения автора и названия

This commit is contained in:
Book Pauk
2019-02-13 13:12:26 +07:00
parent 4bdd33b44f
commit bce31df7e6

View File

@@ -141,17 +141,27 @@ class HistoryPage extends Vue {
} }
const fb2 = (book.fb2 ? book.fb2 : {}); const fb2 = (book.fb2 ? book.fb2 : {});
let title = fb2.bookTitle;
if (title)
title = `"${title}"`;
else
title = '';
let author = _.compact([
fb2.lastName,
fb2.firstName,
fb2.middleName
]).join(' ');
author = (author ? author : (fb2.bookTitle ? fb2.bookTitle : book.url));
result.push({ result.push({
touchDateTime: book.touchTime, touchDateTime: book.touchTime,
touchDate: t[0], touchDate: t[0],
touchTime: t[1], touchTime: t[1],
desc: { desc: {
title: `"${fb2.bookTitle}"${perc}${textLen}`, title: `${title}${perc}${textLen}`,
author: _.compact([ author,
fb2.lastName,
fb2.firstName,
fb2.middleName
]).join(' '),
}, },
url: book.url, url: book.url,
path: book.path, path: book.path,