summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornashe <thomas@chauchefoin.fr>2018-01-04 23:00:32 +0100
committernashe <thomas@chauchefoin.fr>2018-01-04 23:00:32 +0100
commit1e7eb275f0f7dfdf704196fceaee85f45b683691 (patch)
tree1942c6b96493edeeb5ce8ab3e03f309962f4eabe
parentf45a0bb19cd4a108d32acebf303c9fc593ada82b (diff)
downloadplanet-1e7eb275f0f7dfdf704196fceaee85f45b683691.tar
planet-1e7eb275f0f7dfdf704196fceaee85f45b683691.tar.gz
planet-1e7eb275f0f7dfdf704196fceaee85f45b683691.tar.bz2
planet-1e7eb275f0f7dfdf704196fceaee85f45b683691.tar.xz
planet-1e7eb275f0f7dfdf704196fceaee85f45b683691.zip
Revert commit 3510092
This should fix the strange story of `custom/people.opml` disapearing... It should trying to do smart stuff :-)
-rw-r--r--app/classes/Planet.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/app/classes/Planet.php b/app/classes/Planet.php
index c287843..b146eaf 100644
--- a/app/classes/Planet.php
+++ b/app/classes/Planet.php
@@ -179,8 +179,9 @@ class Planet
public function download($max_load=0.1)
{
$max_load_feeds = ceil(count($this->people) * $max_load);
+ $opml = OpmlManager::load(__DIR__.'/../../custom/people.opml');
- foreach ($this->people as &$feed) {
+ foreach ($this->people as $feed) {
//Avoid mass loading with variable cache duration
$feed->set_cache_duration($this->config->getCacheTimeout());
@@ -200,21 +201,25 @@ class Planet
}
$feed->init();
+ $isDown = '';
// http://simplepie.org/wiki/reference/simplepie/merge_items ?
if (($feed->data) && ($feed->get_item_quantity() > 0)){
$items = $feed->get_items();
$this->items = array_merge($this->items, $items);
- $feed['isUp'] = true;
} else {
$this->errors[] = new PlanetError(1, 'No items or down : ' . $feed->getFeed());
- $feed['isDown'] = false;
+ $isDown = '1';
+ }
+
+ foreach ($opml->entries as $key => $entrie) {
+ if ($feed->getFeed() === $entrie['feed']) {
+ $opml->entries[$key]['isDown'] = $isDown;
+ }
}
}
- // FIXME: not sure that it's $this->people?
- // FIXME: make sure we made a change
- OpmlManager::save($this->people, __DIR__.'/../../custom/people.opml');
+ OpmlManager::save($opml, __DIR__.'/../../custom/people.opml');
}
public function sort()