ajout heimdall
This commit is contained in:
39
heimdall/config/www/SupportedApps/Lidarr/Lidarr.php
Executable file
39
heimdall/config/www/SupportedApps/Lidarr/Lidarr.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<?php namespace App\SupportedApps\Lidarr;
|
||||
|
||||
class Lidarr 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()
|
||||
{
|
||||
$test = parent::appTest($this->url('system/status'));
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$status = 'inactive';
|
||||
$missing = json_decode(parent::execute($this->url('wanted/missing'))->getBody());
|
||||
$queue = json_decode(parent::execute($this->url('queue'))->getBody());
|
||||
|
||||
if($missing || $queue) {
|
||||
$data['missing'] = $missing->totalRecords ?? 0;
|
||||
$data['queue'] = $queue->totalRecords ?? 0;
|
||||
}
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
}
|
||||
|
||||
public function url($endpoint)
|
||||
{
|
||||
$api_url = parent::normaliseurl($this->config->url).'api/v1/'.$endpoint.'?apikey='.$this->config->apikey;
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
10
heimdall/config/www/SupportedApps/Lidarr/app.json
Executable file
10
heimdall/config/www/SupportedApps/Lidarr/app.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "c015fff30a3dc43f5987079c0142437e3e757fd0",
|
||||
"name": "Lidarr",
|
||||
"website": "https://lidarr.audio/",
|
||||
"license": "GNU General Public License v3.0 only",
|
||||
"description": "Lidarr is a music collection manager for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new tracks from your favorite artists and will grab, sort and rename them.",
|
||||
"enhanced": true,
|
||||
"tile_background": "dark",
|
||||
"icon": "lidarr.png"
|
||||
}
|
||||
15
heimdall/config/www/SupportedApps/Lidarr/config.blade.php
Executable file
15
heimdall/config/www/SupportedApps/Lidarr/config.blade.php
Executable file
@@ -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) ? $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) ? $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>
|
||||
|
||||
BIN
heimdall/config/www/SupportedApps/Lidarr/lidarr.png
Executable file
BIN
heimdall/config/www/SupportedApps/Lidarr/lidarr.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
10
heimdall/config/www/SupportedApps/Lidarr/livestats.blade.php
Executable file
10
heimdall/config/www/SupportedApps/Lidarr/livestats.blade.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<ul class="livestats">
|
||||
<li>
|
||||
<span class="title">Missing</span>
|
||||
<strong>{!! $missing !!}</strong>
|
||||
</li>
|
||||
<li>
|
||||
<span class="title">Queue</span>
|
||||
<strong>{!! $queue !!}</strong>
|
||||
</li>
|
||||
</ul>
|
||||
Reference in New Issue
Block a user