mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-30 04:51:01 +00:00
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.
This commit is contained in:
parent
07320a2bd2
commit
c57f69d967
1 changed files with 9 additions and 2 deletions
|
@ -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
|
* @param string $method Method to get articles
|
||||||
*
|
*
|
||||||
|
@ -84,7 +86,12 @@ class EntriesExport
|
||||||
$this->author = $method.' authors';
|
$this->author = $method.' authors';
|
||||||
|
|
||||||
if ('entry' === $method) {
|
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;
|
return $this;
|
||||||
|
|
Loading…
Reference in a new issue