From 7975395d10bb381de8cd15b5ee15198318af6d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Viande?= Date: Wed, 11 Apr 2018 11:42:52 +0200 Subject: Entry: add archived_at property and updateArchived method --- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/ImportBundle/Import/InstapaperImport.php') diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index e4f0970c..e113ba00 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -135,7 +135,7 @@ class InstapaperImport extends AbstractImport ); } - $entry->setArchived($importedEntry['is_archived']); + $entry->updateArchived($importedEntry['is_archived']); $entry->setStarred($importedEntry['is_starred']); $this->em->persist($entry); -- cgit v1.2.3 From 9f8f188d928b47503d39348c5990379a572b570a Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 18 Dec 2018 13:14:42 +0100 Subject: Validate imported entry to avoid error on import We got some imports with a missing `url` field generating some errors while trying to retrieve an existing entry with that url. Introducing the `validateEntry` allow us to dismiss a message when it doesn't have an url (or other missing stuff in the future) --- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/Wallabag/ImportBundle/Import/InstapaperImport.php') diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index e4f0970c..5a18c7c0 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -105,6 +105,18 @@ class InstapaperImport extends AbstractImport return true; } + /** + * {@inheritdoc} + */ + public function validateEntry(array $importedEntry) + { + if (empty($importedEntry['url'])) { + return false; + } + + return true; + } + /** * {@inheritdoc} */ -- cgit v1.2.3 From 3afc87426dade0eaeccf69d144a119c6f0c4534f Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 15 Jan 2019 09:49:22 +0100 Subject: CS --- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/ImportBundle/Import/InstapaperImport.php') diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index df1d6666..44c034f8 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -62,7 +62,7 @@ class InstapaperImport extends AbstractImport } $entries = []; - $handle = fopen($this->filepath, 'rb'); + $handle = fopen($this->filepath, 'r'); while (false !== ($data = fgetcsv($handle, 10240))) { if ('URL' === $data[0]) { continue; -- cgit v1.2.3 From 2491c50b6bbb4d51696ad64aa754c1cd0fc83d1b Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 19 Jan 2019 22:24:52 +0100 Subject: Fix status from Instapaper That status was used as `http_status` in ContentProxy->stockEntry --- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Wallabag/ImportBundle/Import/InstapaperImport.php') diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 44c034f8..439c978c 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -79,7 +79,6 @@ class InstapaperImport extends AbstractImport $entries[] = [ 'url' => $data[0], 'title' => $data[1], - 'status' => $data[3], 'is_archived' => 'Archive' === $data[3] || 'Starred' === $data[3], 'is_starred' => 'Starred' === $data[3], 'html' => false, -- cgit v1.2.3 From 9ca670c801cddef0ba47adc3be02945164f6bc85 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 24 May 2019 14:37:54 +0200 Subject: Fix Instapaper import date --- src/Wallabag/ImportBundle/Import/InstapaperImport.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Wallabag/ImportBundle/Import/InstapaperImport.php') diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 439c978c..f7bee9ef 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -93,6 +93,10 @@ class InstapaperImport extends AbstractImport return false; } + // most recent articles are first, which means we should create them at the end so they will show up first + // as Instapaper doesn't export the creation date of the article + $entries = array_reverse($entries); + if ($this->producer) { $this->parseEntriesForProducer($entries); -- cgit v1.2.3