Skip to content

Commit

Permalink
Add Autobrr Enhanced App (#789)
Browse files Browse the repository at this point in the history
* Add Autobrr Enhanced App
* Fix Lint issues
* Add autobrr.png
* chore: lowercase url

---------

Co-authored-by: Martijn van der Kleijn <[email protected]>
  • Loading branch information
0utlawActual and mvdkleijn authored Oct 27, 2024
1 parent fe9be82 commit 9fef906
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Autobrr/Autobrr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace App\SupportedApps\Autobrr;

class Autobrr 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('status'));
echo $test->status;
}

public function livestats()
{
$status = 'inactive';
$res = parent::execute($this->url('status'));
$details = json_decode($res->getBody());

$data = [];
return parent::getLiveStats($status, $data);
}

public function url($endpoint)
{
$api_url = parent::normaliseurl($this->config->url) . $endpoint;
return $api_url;
}
}
10 changes: 10 additions & 0 deletions Autobrr/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"appid": "66506eac84c6980a1beccafa10003ec78da7dd17",
"name": "Autobrr",
"website": "https://autobrr.com",
"license": "Open Public License v1.0",
"description": "autobrr is the modern download automation tool for torrents. With inspiration and ideas from tools like trackarr, autodl-irssi and flexget we built one tool that can do it all, and then some.",
"enhanced": true,
"tile_background": "dark",
"icon": "autobrr.png"
}
Binary file added Autobrr/autobrr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions Autobrr/config.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<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]', null, array('placeholder' => __('app.apps.override'), 'id' => 'override_url', 'class' => 'form-control')) !!}
</div>
<div class="input">
<label>{{ __('app.apps.username') }}</label>
{!! Form::text('config[username]', null, array('placeholder' => __('app.apps.username'), 'data-config' => 'username', 'class' => 'form-control config-item')) !!}
</div>
<div class="input">
<label>{{ __('app.apps.password') }}</label>
{!! Form::input('password', 'config[password]', '', ['placeholder' => __('app.apps.password'), 'data-config' => 'password', 'class' => 'form-control config-item']) !!}
</div>
<div class="input">
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
</div>
</div>

10 changes: 10 additions & 0 deletions Autobrr/livestats.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ul class="livestats">
<li>
<span class="title">Queue</span>
<strong>{!! $queue_size !!}</strong>
</li>
<li>
<span class="title">Speed</span>
<strong>{!! $current_speed !!}</strong>
</li>
</ul>

0 comments on commit 9fef906

Please sign in to comment.