mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Merge remote-tracking branch 'origin/master' into 2.4
This commit is contained in:
commit
3620dae1e6
14 changed files with 185 additions and 66 deletions
|
@ -256,18 +256,17 @@ class ContentProxy
|
|||
$entry->setTitle($content['open_graph']['og_title']);
|
||||
}
|
||||
|
||||
$html = $content['html'];
|
||||
if (false === $html) {
|
||||
$html = $this->fetchingErrorMessage;
|
||||
if (empty($content['html'])) {
|
||||
$content['html'] = $this->fetchingErrorMessage;
|
||||
|
||||
if (!empty($content['open_graph']['og_description'])) {
|
||||
$html .= '<p><i>But we found a short description: </i></p>';
|
||||
$html .= $content['open_graph']['og_description'];
|
||||
$content['html'] .= '<p><i>But we found a short description: </i></p>';
|
||||
$content['html'] .= $content['open_graph']['og_description'];
|
||||
}
|
||||
}
|
||||
|
||||
$entry->setContent($html);
|
||||
$entry->setReadingTime(Utils::getReadingTime($html));
|
||||
$entry->setContent($content['html']);
|
||||
$entry->setReadingTime(Utils::getReadingTime($content['html']));
|
||||
|
||||
if (!empty($content['status'])) {
|
||||
$entry->setHttpStatus($content['status']);
|
||||
|
|
|
@ -165,13 +165,6 @@ class EntriesExport
|
|||
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP');
|
||||
$book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag');
|
||||
|
||||
/*
|
||||
* Front page
|
||||
*/
|
||||
if (file_exists($this->logoPath)) {
|
||||
$book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
|
||||
}
|
||||
|
||||
$entryIds = [];
|
||||
$entryCount = \count($this->entries);
|
||||
$i = 0;
|
||||
|
@ -183,10 +176,19 @@ class EntriesExport
|
|||
// set tags as subjects
|
||||
foreach ($this->entries as $entry) {
|
||||
++$i;
|
||||
|
||||
/*
|
||||
* Front page
|
||||
* Set if there's only one entry in the given set
|
||||
*/
|
||||
if (1 === $entryCount && null !== $entry->getPreviewPicture()) {
|
||||
$book->setCoverImage($entry->getPreviewPicture());
|
||||
}
|
||||
|
||||
foreach ($entry->getTags() as $tag) {
|
||||
$book->setSubject($tag->getLabel());
|
||||
}
|
||||
$filename = sha1($entry->getTitle());
|
||||
$filename = sha1(sprintf('%s:%s', $entry->getUrl(), $entry->getTitle()));
|
||||
|
||||
$publishedBy = $entry->getPublishedBy();
|
||||
$authors = $this->translator->trans('export.unknown');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue