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 @@ +
+
+ + + +
+
+

トレンド

+
+ Subscribe to RSS feed "トレンド" + +
+ + + +
+
+
+
+
+
+ @foreach ($res['video']->data as $v) + @include('theme.'.env('THEME').'.component.peertube.parts.common.videominature') + @endforeach +
+ @include('theme.'.env('THEME').'.component.peertube.parts.common.paginate', [ + 'root' => '/peertube/videos/trending' + ]) +
+
+
+ + + \ No newline at end of file diff --git a/routes/view/peertube.php b/routes/view/peertube.php index 1414d47..eae8f0b 100644 --- a/routes/view/peertube.php +++ b/routes/view/peertube.php @@ -37,9 +37,9 @@ Route::group(['prefix' => 'peertube'], function () { Route::any('/', 'Peertube\Videos\Local@index'); Route::any('/subscriptions', 'Peertube\Videos\Subscriptions@index'); Route::any('/overview', 'Peertube\Videos\Overview@index'); - Route::any('/trending', 'Peertube\Videos\Trending@index'); - Route::any('/recently-added', 'Peertube\Videos\Recentlyadded@index'); - Route::any('/local', 'Peertube\Videos\Local@index'); + Route::any('/trending/{page?}', 'Peertube\Videos\Trending@index'); + Route::any('/recently-added/{page?}', 'Peertube\Videos\Recentlyadded@index'); + Route::any('/local/{page?}', 'Peertube\Videos\Local@index'); Route::any('/upload', 'Peertube\Videos\Upload@index'); }); });