<?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 Overview extends Common {
  private $common;

  public function __construct () {
    $this->common = new Common;
  }

  public function index ($page=1) {
    $res = [
      'page' => 'overview',
      'style' => 'videoslist',
      'paginate' => $page,
      'pagetotal' => 500,
      'userinfo' => $this->common->user,
    ];
    $res['video'] = $this->getVideo($page);
    return view('pages.peertube.videos.overview', ['res' => $res]);
  }

  function getVideo ($page) {
    return $this->ptapi('/api/v1/overviews/videos?page='.$page);
  }
}
