diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-09-30 17:34:30 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-09-30 17:34:30 +0200 |
commit | 6236869ebed317aa06078f606156edcec9f9b55b (patch) | |
tree | 19be979d3200ba90aa77cda4edbf6157755f300a /Zotlabs/Daemon | |
parent | b9b4e71f7d81cca23a08c55fc12db5f62ece2b56 (diff) | |
download | volse-hubzilla-6236869ebed317aa06078f606156edcec9f9b55b.tar.gz volse-hubzilla-6236869ebed317aa06078f606156edcec9f9b55b.tar.bz2 volse-hubzilla-6236869ebed317aa06078f606156edcec9f9b55b.zip |
implement file totals and add mod import_progress
Diffstat (limited to 'Zotlabs/Daemon')
-rw-r--r-- | Zotlabs/Daemon/File_importer.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Zotlabs/Daemon/File_importer.php b/Zotlabs/Daemon/File_importer.php index bb12cdf70..28fb172a7 100644 --- a/Zotlabs/Daemon/File_importer.php +++ b/Zotlabs/Daemon/File_importer.php @@ -48,12 +48,18 @@ class File_importer { $j = json_decode($x['body'],true); - if(! is_array($j[0]['attach']) || ! count($j[0]['attach'])) { - PConfig::Set($channel['channel_id'], 'import', 'files', 1); + if(! is_array($j['results'][0]['attach']) || ! count($j['results'][0]['attach'])) { return; } - $r = sync_files($channel,$j); + $r = sync_files($channel, $j['results']); + + PConfig::Set($channel['channel_id'], 'import', 'files_progress', [ + 'files_total' => $j['total'], + 'files_page' => 1, // export page atm returns just one file + 'last_page' => $page, + 'next_cmd' => ['File_importer',sprintf('%d',$page + 1), $channel['channel_address'], urlencode($hz_server)] + ]); $page++; |