コミットを比較
2 コミット
4543a7e5cf
...
7e11ac4375
作成者 | SHA1 | 日付 |
---|---|---|
守矢諏訪子 | 7e11ac4375 | |
守矢諏訪子 | ac18744874 |
|
@ -8,39 +8,59 @@ use App\Http\Controllers\Peertube\Common;
|
|||
|
||||
class Account extends Common {
|
||||
private $common;
|
||||
private $count;
|
||||
|
||||
public function __construct () {
|
||||
$this->common = new Common;
|
||||
$this->count = 25;
|
||||
}
|
||||
|
||||
public function index ($id, $cat='video-channels') {
|
||||
public function index ($id, $cat='video-channels', $page=0) {
|
||||
$res = [
|
||||
'page' => 'account',
|
||||
'style' => 'account',
|
||||
'cat' => $cat,
|
||||
'paginate' => $page,
|
||||
'pagetotal' => 500,
|
||||
'userinfo' => $this->common->user,
|
||||
];
|
||||
|
||||
$res['owner'] = $this->getOwner($id);
|
||||
if (!empty($res['owner'])) $res['owner']->totalVideo = 0;
|
||||
$res['channel'] = $this->getChannel($id);
|
||||
$res['channel'] = $this->getChannel($id, $cat, ($page*$this->count), $this->count);
|
||||
if (!empty($res['owner'])) {
|
||||
foreach ($res['channel']->data as $k => $v) {
|
||||
$res['channel']->data[$k]->video = $this->getVideo($v->name.'@'.$v->host);
|
||||
$res['owner']->totalVideo += $res['channel']->data[$k]->video->total;
|
||||
if ($cat == 'video-channels') {
|
||||
$stats = $this->ptapi('/api/v1/accounts/'.$id.'/videos?start=0&count=0&skipCount=false&nsfw=both');
|
||||
$res['owner']->totalVideo = $stats->total;
|
||||
foreach ($res['channel']->data as $k => $v) {
|
||||
$res['channel']->data[$k]->video = $this->getVideo($v->name.'@'.$v->host);
|
||||
$res['owner']->followersCount += $v->followersCount;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$stats = $this->ptapi('/api/v1/accounts/'.$id.'/video-channels?start=0&count=20');
|
||||
$res['owner']->totalVideo = $res['channel']->total;
|
||||
foreach ($stats->data as $k => $v) {
|
||||
$res['channel']->data[$k]->video = $this->getVideo($v->name.'@'.$v->host);
|
||||
$res['owner']->followersCount += $v->followersCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
return view('pages.peertube.a', ['res' => $res]);
|
||||
|
||||
return view('pages.peertube.a', ['res' => $res, 'cat' => $cat]);
|
||||
}
|
||||
|
||||
function getOwner ($id) {
|
||||
return $this->ptapi('/api/v1/accounts/'.$id);
|
||||
}
|
||||
|
||||
function getChannel ($id) {
|
||||
return $this->ptapi('/api/v1/accounts/'.$id.'/video-channels?start=0&count=20&sort=-updatedAt&withStats=false');
|
||||
function getChannel ($id, $cat, $start, $count) {
|
||||
if ($cat == 'video-channels') $count = 5;
|
||||
$sort = $cat == 'video-channels' ? '-updatedAt&withStats=false' : '-publishedAt&skipCount=false&nsfw=both';
|
||||
return $this->ptapi('/api/v1/accounts/'.$id.'/'.$cat.'?start='.$start.'&count='.$count.'&sort='.$sort);
|
||||
}
|
||||
|
||||
function getVideo ($id) {
|
||||
return $this->ptapi('/api/v1/video-channels/'.$id.'/videos?start=0&count=5&sort=-publishedAt&nsfw=both');
|
||||
return $this->ptapi('/api/v1/video-channels/'.$id.'/videos?start=0&count=5&sort=-publishedAt&skipCount=false&nsfw=both');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,14 +103,6 @@ input {
|
|||
.avatar-34 {
|
||||
--avatarSize: 34px !important;
|
||||
}
|
||||
.avatar {
|
||||
--avatarSize: 100%;
|
||||
--initialFontSize: 22px;
|
||||
width: var(--avatarSize);
|
||||
height: var(--avatarSize);
|
||||
min-width: var(--avatarSize);
|
||||
min-height: var(--avatarSize);
|
||||
}
|
||||
.video-info-channel {
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
|
@ -973,17 +965,9 @@ my-actor-avatar {
|
|||
font-weight: 600;
|
||||
}
|
||||
|
||||
.avatar.channel {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.account-info {
|
||||
padding-inline-end: var(--gridVideosMiniatureMargins)!important;
|
||||
}
|
||||
.account-info {
|
||||
padding-inline-start: var(--gridVideosMiniatureMargins)!important;
|
||||
}
|
||||
.account-info {
|
||||
--gridVideosMiniatureMargins: var(--videosHorizontalMarginContent);
|
||||
display: grid;
|
||||
grid-template-columns: 1fr -webkit-min-content;
|
||||
|
@ -1642,4 +1626,4 @@ button {
|
|||
}
|
||||
.btn-group-subscribe:not(.big) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="channel-avatar-row">
|
||||
<my-actor-avatar title="この動画チャンネルを見る">
|
||||
<a title="この動画チャンネルを見る" href="/c/{{ $fullchan }}" class="ng-star-inserted">
|
||||
<img class="avatar channel ng-star-inserted" src="{{ ptAvatar($ch) }}" alt="チャンネルのアバター">
|
||||
<img class="avatar channelng ng-star-inserted" src="{{ ptAvatar($ch) }}" alt="チャンネルのアバター">
|
||||
</a>
|
||||
</my-actor-avatar>
|
||||
<h2>
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<my-list-overflow>
|
||||
<div class="d-flex align-items-center text-nowrap w-100 list-overflow-parent">
|
||||
<span id="pe_0" class="ng-star-inserted" style="visibility: inherit;">
|
||||
<a class="title-page ng-star-inserted active" href="/a/{{ ptFullHandle($res['owner']) }}/video-channels">チャンネル</a>
|
||||
<a class="title-page ng-star-inserted{{ $cat == 'video-channels' ? ' active' : '' }}" href="/a/{{ ptFullHandle($res['owner']) }}/video-channels">チャンネル</a>
|
||||
</span>
|
||||
<span id="pe_1" class="ng-star-inserted" style="visibility: inherit;">
|
||||
<a class="title-page ng-star-inserted" href="/a/{{ ptFullHandle($res['owner']) }}/videos">動画</a>
|
||||
<a class="title-page ng-star-inserted{{ $cat == 'videos' ? ' active' : '' }}" href="/a/{{ ptFullHandle($res['owner']) }}/videos">動画</a>
|
||||
</span>
|
||||
</div>
|
||||
</my-list-overflow>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<div class="margin-content">
|
||||
<div class="videos">
|
||||
@foreach ($res['channel']->data as $v)
|
||||
@include('layout.component.common.videominature')
|
||||
@endforeach
|
||||
</div>
|
||||
@include('layout.component.common.paginate', [
|
||||
'root' => '/a/'.$res['owner']->name.($res['owner']->host != 'video.076.ne.jp' ? '@'.$res['owner']->host : '').'/'.$res['cat']
|
||||
])
|
||||
</div>
|
|
@ -6,11 +6,6 @@
|
|||
<img class="avatar channel ng-star-inserted" src="{{ ptAvatar($res['detail']->channel) }}" alt="チャンネルのアバター">
|
||||
</a>
|
||||
</my-actor-avatar>
|
||||
<my-actor-avatar class="account">
|
||||
<a title="{{ ptFullHandle($res['detail']->account) }} (アカウントページへ) " href="/a/{{ ptFullHandle($res['detail']->account) }}" class="ng-star-inserted">
|
||||
<img class="account avatar ng-star-inserted" src="{{ ptAvatar($res['detail']->account) }}" alt="アカウントのアバター">
|
||||
</a>
|
||||
</my-actor-avatar>
|
||||
</div>
|
||||
</my-video-avatar-channel>
|
||||
<div class="video-info-channel-left-links ml-1">
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
<div class="root ng-star-inserted">
|
||||
@include('layout.component.a.info')
|
||||
@include('layout.component.a.links')
|
||||
@include('layout.component.a.channels')
|
||||
@if ($cat == 'videos')
|
||||
@include('layout.component.a.videos')
|
||||
@else
|
||||
@include('layout.component.a.channels')
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@ use Illuminate\Support\Facades\Route;
|
|||
Route::any('/', 'Peertube\Home@index');
|
||||
Route::any('/home', 'Peertube\Home@index');
|
||||
|
||||
Route::any('/a/{id}/{cat?}', 'Peertube\Account@index');
|
||||
Route::any('/a/{id}/{cat?}/{page?}', 'Peertube\Account@index');
|
||||
Route::any('/c/{id}/{cat?}/{page?}', 'Peertube\Channel@index');
|
||||
Route::any('/w/{id}', 'Peertube\Watch@index');
|
||||
|
||||
|
|
新しいイシューから参照