Channel List set to use new paginated SDK

This commit is contained in:
Paul Kirby 2020-01-27 17:00:13 -06:00
parent 61a8544ece
commit d39503de10
2 changed files with 8 additions and 3 deletions

View file

@ -87,12 +87,18 @@ class LBRY_Daemon
/** /**
* Returns a list of channels for this account * Returns a list of channels for this account
* https://lbry.tech/api/sdk#channel_list * https://lbry.tech/api/sdk#channel_list
* @param int $page Pagination page number
* @return array claim dictionary or null if empty * @return array claim dictionary or null if empty
*/ */
public function channel_list() public function channel_list($page = 1)
{ {
$params = array(
'page' => $page,
'page_size' => 20
);
try { try {
$result = $this->request('channel_list')->result; $result = $this->request('channel_list', $params)->result->items;
return empty($result) ? null : $result; return empty($result) ? null : $result;
} catch (LBRYDaemonException $e) { } catch (LBRYDaemonException $e) {
$this->logger->log('channel_list error', $e->getMessage() . ' | Code: ' . $e->getCode()); $this->logger->log('channel_list error', $e->getMessage() . ' | Code: ' . $e->getCode());

View file

@ -17,7 +17,6 @@ $channel_list = $LBRY->daemon->channel_list();
</form> </form>
<h2>Your Publishable Channels</h2> <h2>Your Publishable Channels</h2>
<?php if ($channel_list): ?> <?php if ($channel_list): ?>
<?php error_log(print_r($channel_list, true)); ?>
<ul class="lbry-channel-list"> <ul class="lbry-channel-list">
<?php foreach ($channel_list as $channel): ?> <?php foreach ($channel_list as $channel): ?>
<li><?= $channel->name ?></li> <li><?= $channel->name ?></li>