選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

39 行
1.1 KiB

<?php
namespace App\Http\Controllers\Peertube;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Http\Controllers\Peertube\Common;
// use Illuminate\Support\Facades\Log;
class Channel extends Common {
private $common;
private $count;
public function __construct () {
$this->common = new Common;
$this->count = 25;
}
public function index ($id, $cat='videos', $page=0) {
$res = [
'page' => 'channel',
'cat' => $cat,
'paginate' => $page,
'pagetotal' => 500,
'userinfo' => $this->common->user,
];
$res['channel'] = $this->getChannel($id);
$res['video'] = $this->getVideo($id, ($page*$this->count), $this->count);
$res['pagetotal'] = $res['video']->total;
return view('pages.peertube.c', ['res' => $res]);
}
function getChannel ($id) {
return $this->ptapi_get('/api/v1/video-channels/'.$id);
}
function getVideo ($id, $start, $count) {
return $this->ptapi_get('/api/v1/video-channels/'.$id.'/videos?start='.$start.'&count='.$count.'&sort=-publishedAt&skipCount=false&nsfw=both');
}
}