[fix] #375 Readability.com changed its export format

This commit is contained in:
Nicolas Lœuillet 2014-01-03 15:18:13 +01:00
parent 4d058d4824
commit 9bc32632af
1 changed files with 28 additions and 25 deletions

View File

@ -806,15 +806,16 @@ class Poche
$url = NULL; $url = NULL;
$favorite = FALSE; $favorite = FALSE;
$archive = FALSE; $archive = FALSE;
foreach ($value as $attr => $attr_value) { foreach ($value as $item) {
foreach ($item as $attr => $value) {
if ($attr == 'article__url') { if ($attr == 'article__url') {
$url = new Url(base64_encode($attr_value)); $url = new Url(base64_encode($value));
} }
$sequence = ''; $sequence = '';
if (STORAGE == 'postgres') { if (STORAGE == 'postgres') {
$sequence = 'entries_id_seq'; $sequence = 'entries_id_seq';
} }
if ($attr_value == 'true') { if ($value == 'true') {
if ($attr == 'favorite') { if ($attr == 'favorite') {
$favorite = TRUE; $favorite = TRUE;
} }
@ -823,6 +824,7 @@ class Poche
} }
} }
} }
# we can add the url # we can add the url
if (!is_null($url) && $url->isCorrect()) { if (!is_null($url) && $url->isCorrect()) {
$this->action('add', $url, 0, TRUE); $this->action('add', $url, 0, TRUE);
@ -837,6 +839,7 @@ class Poche
} }
} }
} }
}
$this->messages->add('s', _('import from Readability completed. ' . $count . ' new links.')); $this->messages->add('s', _('import from Readability completed. ' . $count . ' new links.'));
Tools::logm('import from Readability completed'); Tools::logm('import from Readability completed');
Tools::redirect(); Tools::redirect();