<?php

namespace Ministra\Lib;

use Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e;
class WowzaTvArchive extends \Ministra\Lib\TvArchive
{
    public function __construct()
    {
        parent::__construct();
    }
    protected function getAllActiveStorages()
    {
        $storages = [];
        $data = $this->db->from('storages')->where(['status' => 1, 'for_records' => 1, 'wowza_dvr' => 1])->get()->all();
        foreach ($data as $idx => $storage) {
            $storages[$storage['storage_name']] = $storage;
            $storages[$storage['storage_name']]['load'] = $this->getStorageLoad($storage);
            $storages[$storage['storage_name']]['storage_ip'] = $storage['storage_ip'];
        }
        $storages = $this->sortByLoad($storages);
        return $storages;
    }
    protected function deleteTaskById($task_id)
    {
        return \Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e::getInstance()->delete('tv_archive', ['id' => $task_id]);
    }
}
