diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-09-29 21:47:12 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-09-29 21:47:12 +0200 |
commit | 4ba47698d7d0ef6c799bd0a28045c1d1e49c76f3 (patch) | |
tree | c2f3b62d4b0e1290e27b05de91574310c4f3832c /Zotlabs/Daemon/Content_importer.php | |
parent | 5eb79bd51efbd69d297bbd6f46ee9d1583ec694e (diff) | |
download | volse-hubzilla-4ba47698d7d0ef6c799bd0a28045c1d1e49c76f3.tar.gz volse-hubzilla-4ba47698d7d0ef6c799bd0a28045c1d1e49c76f3.tar.bz2 volse-hubzilla-4ba47698d7d0ef6c799bd0a28045c1d1e49c76f3.zip |
revise content import/export part 2
Diffstat (limited to 'Zotlabs/Daemon/Content_importer.php')
-rw-r--r-- | Zotlabs/Daemon/Content_importer.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Zotlabs/Daemon/Content_importer.php b/Zotlabs/Daemon/Content_importer.php index 72b8e34ce..ff6956051 100644 --- a/Zotlabs/Daemon/Content_importer.php +++ b/Zotlabs/Daemon/Content_importer.php @@ -23,7 +23,7 @@ class Content_importer { $channel = channelx_by_nick($channel_address); if(! $channel) { - logger('itemhelper: channel not found'); + logger('channel not found'); return; } @@ -44,7 +44,6 @@ class Content_importer { } $j = json_decode($x['body'],true); - if (! $j) { return; } @@ -52,8 +51,19 @@ class Content_importer { if(! is_array($j['item']) || ! count($j['item'])) return; + //$total_pages = floor(intval($j['items_total']) / intval($j['items_page'])); + //logger('importing items: ' . floor((intval($page) * 100) / $total_pages) . '%'); + + $saved_notification_flags = notifications_off($channel['channel_id']); + import_items($channel,$j['item'],false,((array_key_exists('relocate',$j)) ? $j['relocate'] : null)); + notifications_on($channel['channel_id'], $saved_notification_flags); + + $page++; + + Master::Summon([ 'Content_importer', sprintf('%d',$page), $since, $until, $channel['channel_address'], urlencode($hz_server) ]); + return; } } |