Browse Source

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

Book Pauk 6 years ago
parent
commit
bce31df7e6
1 changed files with 16 additions and 6 deletions
  1. 16 6
      client/components/Reader/HistoryPage/HistoryPage.vue

+ 16 - 6
client/components/Reader/HistoryPage/HistoryPage.vue

@@ -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}`,
-                    author: _.compact([
-                        fb2.lastName,
-                        fb2.firstName,
-                        fb2.middleName
-                    ]).join(' '),
+                    title: `${title}${perc}${textLen}`,
+                    author,
                 },
                 },
                 url: book.url,
                 url: book.url,
                 path: book.path,
                 path: book.path,