aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index 64591687..a2aa4d13 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -165,13 +165,6 @@ class EntriesExport
165 $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP'); 165 $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'PHP');
166 $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag'); 166 $book->addDublinCoreMetadata(DublinCore::CONTRIBUTOR, 'wallabag');
167 167
168 /*
169 * Front page
170 */
171 if (file_exists($this->logoPath)) {
172 $book->setCoverImage('Cover.png', file_get_contents($this->logoPath), 'image/png');
173 }
174
175 $entryIds = []; 168 $entryIds = [];
176 $entryCount = \count($this->entries); 169 $entryCount = \count($this->entries);
177 $i = 0; 170 $i = 0;
@@ -183,6 +176,15 @@ class EntriesExport
183 // set tags as subjects 176 // set tags as subjects
184 foreach ($this->entries as $entry) { 177 foreach ($this->entries as $entry) {
185 ++$i; 178 ++$i;
179
180 /*
181 * Front page
182 * Set if there's only one entry in the given set
183 */
184 if (1 === $entryCount && null !== $entry->getPreviewPicture()) {
185 $book->setCoverImage($entry->getPreviewPicture());
186 }
187
186 foreach ($entry->getTags() as $tag) { 188 foreach ($entry->getTags() as $tag) {
187 $book->setSubject($tag->getLabel()); 189 $book->setSubject($tag->getLabel());
188 } 190 }