このリポジトリは2023-09-09にアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュ、イシューの作成、プルリクエストはできません。
076server/app/Http/Controllers/Peertube/Videos/Local.php

35 行
927 B
PHP
Raw 通常表示 履歴

2021-12-16 01:25:29 +09:00
<?php
namespace App\Http\Controllers\Peertube\Videos;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Http\Controllers\Peertube\Common;
// use Illuminate\Support\Facades\Log;
class Local extends Common {
private $common;
2021-12-16 13:02:06 +09:00
private $count;
2021-12-16 01:25:29 +09:00
public function __construct () {
$this->common = new Common;
2021-12-16 13:02:06 +09:00
$this->count = 50;
2021-12-16 01:25:29 +09:00
}
2021-12-16 13:02:06 +09:00
public function index ($page=0) {
2021-12-16 01:25:29 +09:00
$res = [
2021-12-16 16:31:55 +09:00
'page' => 'local',
'style' => 'videoslist',
2021-12-16 13:02:06 +09:00
'paginate' => $page,
'pagetotal' => 500,
2021-12-16 01:25:29 +09:00
'userinfo' => $this->common->user,
];
2021-12-16 13:02:06 +09:00
$res['video'] = $this->getVideo(($page*$this->count), $this->count);
2021-12-16 01:25:29 +09:00
return view('pages.peertube.videos.local', ['res' => $res]);
}
2021-12-16 13:02:06 +09:00
function getVideo ($start, $count) {
2021-12-16 21:25:35 +09:00
$get = $this->ptapi_get('/api/v1/videos?start='.$start.'&count='.$count.'&sort=-publishedAt&skipCount=true&isLocal=true&nsfw=both');
2021-12-16 01:25:29 +09:00
return $this->vidlist($get);
}
}