From c57f69d967dea05e507e997193a783fed991de8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Gilli?= Date: Sun, 9 Jul 2017 18:33:14 +0200 Subject: Use the article publisher as author for export When exporting an entry, use the publishedBy field as author name for epub, mobi and pdf formats. Fallback to domain name if empty. --- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index d749dcf9..e16168b1 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -73,7 +73,9 @@ class EntriesExport } /** - * Sets the author for just one entry. + * Sets the author for one entry or category. + * + * The publishers are used, or the domain name if empty. * * @param string $method Method to get articles * @@ -84,7 +86,12 @@ class EntriesExport $this->author = $method.' authors'; if ('entry' === $method) { - $this->author = $this->entries[0]->getDomainName(); + $publishedBy = $this->entries[0]->getPublishedBy(); + if (!empty($publishedBy)) { + $this->author = implode(', ', $this->entries[0]->getPublishedBy()); + } else { + $this->author = $this->entries[0]->getDomainName(); + } } return $this; -- cgit v1.2.3