Улучшил парсинг имени автора из fb2

This commit is contained in:
Book Pauk
2019-03-15 11:27:34 +07:00
parent cd5d3903fe
commit 37d60bc9b9
3 changed files with 38 additions and 14 deletions

View File

@@ -164,11 +164,21 @@ class HistoryPage extends Vue {
else
title = '';
let author = _.compact([
fb2.lastName,
fb2.firstName,
fb2.middleName
]).join(' ');
let author = '';
if (fb2.author) {
const authorNames = fb2.author.map(a => _.compact([
a.lastName,
a.firstName,
a.middleName
]).join(' '));
author = authorNames.join(', ');
} else {
author = _.compact([
fb2.lastName,
fb2.firstName,
fb2.middleName
]).join(' ');
}
author = (author ? author : (fb2.bookTitle ? fb2.bookTitle : book.url));
result.push({