-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e80ddb5
commit e12ba48
Showing
5 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace App\SupportedApps\Maintainerr; | ||
|
||
class Maintainerr 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 | ||
|
||
public function __construct() | ||
{ | ||
//$this->jar = new \GuzzleHttp\Cookie\CookieJar; // Uncomment if cookies need to be set | ||
} | ||
|
||
public function test() | ||
{ | ||
$test = parent::appTest($this->url("")); | ||
echo $test->status; | ||
} | ||
|
||
public function livestats() | ||
{ | ||
$status = "inactive"; | ||
$data = []; | ||
|
||
$rules = json_decode(parent::execute($this->url("api/rules"))->getBody()); | ||
$activeRules = $filteredObjects = array_filter($rules, function ($rule) { | ||
return isset($rule->isActive) && $rule->isActive; | ||
}); | ||
|
||
$data["rules"] = count($activeRules); | ||
|
||
return parent::getLiveStats($status, $data); | ||
} | ||
|
||
public function url($endpoint) | ||
{ | ||
$api_url = parent::normaliseurl($this->config->url) . $endpoint; | ||
return $api_url; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"appid": "34048cd0432f63fda7286fc2d843f0d68b4d28c5", | ||
"name": "Maintainerr", | ||
"website": "https://maintainerr.info", | ||
"license": "MIT license", | ||
"description": "Maintainerr makes managing your media easy. It’s a one-stop-shop for handling those outlying shows and movies that take up precious space", | ||
"enhanced": true, | ||
"tile_background": "dark", | ||
"icon": "maintainerr.svg" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<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, ['placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control']) !!} | ||
</div> | ||
<div class="input"> | ||
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<ul class="livestats"> | ||
<li> | ||
<span class="title">Rules</span> | ||
<strong>{!! $rules !!}</strong> | ||
</li> | ||
</ul> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.