ajout heimdall
This commit is contained in:
+50
@@ -0,0 +1,50 @@
|
||||
<?php namespace App\SupportedApps\Bazarr;
|
||||
|
||||
class Bazarr extends \App\SupportedApps implements \App\EnhancedApps {
|
||||
|
||||
public $config;
|
||||
|
||||
//protected $login_first = true; // Uncomment if api requests need to be authed first
|
||||
//protected $method = 'POST'; // Uncomment if requests to the API should be set by POST
|
||||
|
||||
function __construct() {
|
||||
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$attrs = [
|
||||
'headers' => ['Accept' => 'application/json']
|
||||
];
|
||||
$test = parent::appTest($this->url('systemstatus'), $attrs);
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$status = 'inactive';
|
||||
$data = [];
|
||||
$attrs = [
|
||||
'headers' => ['Accept' => 'application/json']
|
||||
];
|
||||
|
||||
|
||||
$badges = json_decode(parent::execute($this->url('badges'), $attrs)->getBody());
|
||||
|
||||
$data = [];
|
||||
|
||||
if($badges) {
|
||||
$data['movies'] = $badges->movies ?? 0;
|
||||
$data['series'] = $badges->episodes ?? 0;
|
||||
}
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
|
||||
}
|
||||
|
||||
public function url($endpoint)
|
||||
{
|
||||
$api_url = parent::normaliseurl($this->config->url).'api/'.$endpoint.'?apikey='.$this->config->apikey;
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"appid": "085f0b437f9bf9c98bb68b745c8dcf323a7e0499",
|
||||
"name": "Bazarr",
|
||||
"website": "https://github.com/morpheus65535/bazarr",
|
||||
"license": "GNU General Public License v3.0 only",
|
||||
"description": "Bazarr is a companion application to Sonarr and Radarr. It manage and download subtitles based on your requirements. You defined your preferences by TV show or movies and Bazarr take care of everything for you.",
|
||||
"enhanced": true,
|
||||
"tile_background": "dark",
|
||||
"icon": "bazarr.png",
|
||||
"config": {
|
||||
"type": "apikey",
|
||||
"stat1": {
|
||||
"name": "missing series",
|
||||
"url": ":url:/api/episodes/wanted?apikey=:apikey:",
|
||||
"key": "total",
|
||||
"filter": "none",
|
||||
"updateOnChange": "No"
|
||||
},
|
||||
"stat2": {
|
||||
"name": "missing movies",
|
||||
"url": ":url:/api/movies/wanted?apikey=:apikey:",
|
||||
"key": "total",
|
||||
"filter": "none",
|
||||
"updateOnChange": "No"
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@@ -0,0 +1,15 @@
|
||||
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
|
||||
<div class="items">
|
||||
<div class="input">
|
||||
<label>{{ strtoupper(__('app.url')) }}</label>
|
||||
{!! Form::text('config[override_url]', (isset($item) && isset($item->getconfig()->override_url) ? $item->getconfig()->override_url : null), array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<label>{{ __('app.apps.apikey') }}</label>
|
||||
{!! Form::text('config[apikey]', (isset($item) && isset($item->getconfig()->apikey) ? $item->getconfig()->apikey : null), array('placeholder' => __('app.apps.apikey'), 'data-config' => 'apikey', 'class' => 'form-control config-item')) !!}
|
||||
</div>
|
||||
<div class="input">
|
||||
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<ul class="livestats">
|
||||
<li>
|
||||
<span class="title">Movies</span>
|
||||
<strong>{!! $movies !!}</strong>
|
||||
</li>
|
||||
<li>
|
||||
<span class="title">Episodes</span>
|
||||
<strong>{!! $series !!}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user