82df35a59b
This is a major change for the next release of Miniflux. - There is now only one database that can supports multiple users - There is no automated schema migration for this release - A migration procedure is available in the ChangeLog file
34 lines
729 B
PHP
34 lines
729 B
PHP
<?php
|
|
|
|
namespace Miniflux\Handler\Item;
|
|
|
|
use Miniflux\Handler;
|
|
use Miniflux\Helper;
|
|
use Miniflux\Model;
|
|
use PicoDb\Database;
|
|
|
|
function download_item_content($user_id, $item_id)
|
|
{
|
|
$item = Model\Item\get_item($user_id, $item_id);
|
|
$content = Handler\Scraper\download_content($item['url']);
|
|
|
|
if (! empty($content)) {
|
|
if (! Helper\config('nocontent')) {
|
|
Database::getInstance('db')
|
|
->table('items')
|
|
->eq('id', $item['id'])
|
|
->save(array('content' => $content));
|
|
}
|
|
|
|
return array(
|
|
'result' => true,
|
|
'content' => $content
|
|
);
|
|
}
|
|
|
|
return array(
|
|
'result' => false,
|
|
'content' => ''
|
|
);
|
|
}
|