ajout heimdall
This commit is contained in:
49
heimdall/config/www/SupportedApps/RuneAudio/RuneAudio.php
Executable file
49
heimdall/config/www/SupportedApps/RuneAudio/RuneAudio.php
Executable file
@@ -0,0 +1,49 @@
|
||||
<?php namespace App\SupportedApps\RuneAudio;
|
||||
|
||||
class RuneAudio 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('status'));
|
||||
echo $test->status;
|
||||
}
|
||||
|
||||
public function livestats()
|
||||
{
|
||||
$status = 'inactive';
|
||||
$res = parent::execute($this->url('currentsong'));
|
||||
|
||||
$array = explode("\n", $res->getBody());
|
||||
foreach($array as $item) {
|
||||
$item_array = explode(": ", $item);
|
||||
if ($item_array[0] == 'Artist') {
|
||||
$artist = $item_array[1];
|
||||
} elseif ($item_array[0] == 'Title') {
|
||||
$song_title = $item_array[1];
|
||||
}
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
$data['artist'] = $artist ?? 'None';
|
||||
$data['song_title'] = $song_title ?? 'None';
|
||||
|
||||
return parent::getLiveStats($status, $data);
|
||||
|
||||
}
|
||||
|
||||
public function url($endpoint)
|
||||
{
|
||||
$api_url = parent::normaliseurl($this->config->url).'command/?cmd='.$endpoint;
|
||||
return $api_url;
|
||||
}
|
||||
}
|
||||
10
heimdall/config/www/SupportedApps/RuneAudio/app.json
Executable file
10
heimdall/config/www/SupportedApps/RuneAudio/app.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"appid": "11f6ce44eb513a288ca4ef26cbbdb3fece2d6ec4",
|
||||
"name": "RuneAudio",
|
||||
"website": "http://www.runeaudio.com/",
|
||||
"license": "GNU General Public License v3.0 or later",
|
||||
"description": "RuneAudio is a free and open source software that turns inexpensive, silent and low-consumption mini-PC into Hi-Fi music players.",
|
||||
"enhanced": true,
|
||||
"tile_background": "dark",
|
||||
"icon": "runeaudio.png"
|
||||
}
|
||||
12
heimdall/config/www/SupportedApps/RuneAudio/config.blade.php
Executable file
12
heimdall/config/www/SupportedApps/RuneAudio/config.blade.php
Executable file
@@ -0,0 +1,12 @@
|
||||
<h2>{{ __('app.apps.config') }} ({{ __('app.optional') }}) @include('items.enable')</h2>
|
||||
<div class="items">
|
||||
<input type="hidden" data-config="dataonly" class="config-item" name="config[dataonly]" value="1" />
|
||||
<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">
|
||||
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
16
heimdall/config/www/SupportedApps/RuneAudio/livestats.blade.php
Executable file
16
heimdall/config/www/SupportedApps/RuneAudio/livestats.blade.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<ul class="livestats flexcolumn">
|
||||
<li>
|
||||
@if(strlen($artist) > 12)
|
||||
<div class="title-marquee"><span><span class="title">Artist</span>{!! $artist !!}</span></div>
|
||||
@else
|
||||
<div class="no-marquee"><span><span class="title">Artist</span>{!! $artist !!}</span></div>
|
||||
@endif
|
||||
</li>
|
||||
<li>
|
||||
@if(strlen($song_title) > 12)
|
||||
<div class="title-marquee"><span><span class="title">Song</span>{!! $song_title !!}</span></div>
|
||||
@else
|
||||
<div class="no-marquee"><span><span class="title">Song</span>{!! $song_title !!}</span></div>
|
||||
@endif
|
||||
</li>
|
||||
</ul>
|
||||
BIN
heimdall/config/www/SupportedApps/RuneAudio/runeaudio.png
Executable file
BIN
heimdall/config/www/SupportedApps/RuneAudio/runeaudio.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
Reference in New Issue
Block a user