diff --git a/app/Http/Controllers/Peertube/Videos/Trending.php b/app/Http/Controllers/Peertube/Videos/Trending.php index ca7b7f9..7b3f5e5 100644 --- a/app/Http/Controllers/Peertube/Videos/Trending.php +++ b/app/Http/Controllers/Peertube/Videos/Trending.php @@ -8,22 +8,25 @@ use App\Http\Controllers\Peertube\Common; class Trending extends Common { private $common; + private $count; public function __construct () { $this->common = new Common; + $this->count = 25; } - public function index () { + public function index ($page=0) { $res = [ - 'page' => 'dummy', + 'page' => 'videoslist', + 'paginate' => $page, + 'pagetotal' => 500, 'userinfo' => $this->common->user, ]; - // $res['owner'] = $this->getOwner($id); - return view('pages.peertube.notyet', ['res' => $res]); + $res['video'] = $this->getVideo(($page*$this->count), $this->count); + return view('pages.peertube.videos.trending', ['res' => $res]); } - function getOwner ($id) { - //https://video.076.ne.jp/api/v1/videos/?start=0&count=25&sort=-trending&skipCount=true&nsfw=both - return $this->ptapi_get('/api/v1/accounts/'.$id); + function getVideo ($start, $count) { + return $this->ptapi_get('/api/v1/videos/?start='.$start.'&count='.$count.'&sort=-trending&skipCount=true&nsfw=both'); } } diff --git a/resources/views/pages/peertube/videos/trending.blade.php b/resources/views/pages/peertube/videos/trending.blade.php new file mode 100644 index 0000000..cb264ad --- /dev/null +++ b/resources/views/pages/peertube/videos/trending.blade.php @@ -0,0 +1,5 @@ +@extends('theme.'.env('THEME').'.peertube') + +@section('content') + @include('theme.'.env('THEME').'.component.peertube.videos.trending') +@endsection diff --git a/resources/views/theme/techsuwa/component/peertube/videos/trending.blade.php b/resources/views/theme/techsuwa/component/peertube/videos/trending.blade.php new file mode 100644 index 0000000..9494c5d --- /dev/null +++ b/resources/views/theme/techsuwa/component/peertube/videos/trending.blade.php @@ -0,0 +1,34 @@ +