diff --git a/app/Item.php b/app/Item.php
index 37727fde..2858c42e 100644
--- a/app/Item.php
+++ b/app/Item.php
@@ -51,6 +51,7 @@ class Item extends Model
'Portainer' => \App\SupportedApps\Portainer::class,
'Proxmox' => \App\SupportedApps\Proxmox::class,
'Radarr' => \App\SupportedApps\Radarr::class,
+ 'Runeaudio' => \App\SupportedApps\Runeaudio::class,
'Sabnzbd' => \App\SupportedApps\Sabnzbd::class,
'Sonarr' => \App\SupportedApps\Sonarr::class,
'Traefik' => \App\SupportedApps\Traefik::class,
diff --git a/app/SupportedApps/Plexpy.php b/app/SupportedApps/Plexpy.php
index 212c3dd1..4b044fac 100644
--- a/app/SupportedApps/Plexpy.php
+++ b/app/SupportedApps/Plexpy.php
@@ -1,6 +1,12 @@
buildRequest('arnold');
+ switch($res->getStatusCode()) {
+ case 200:
+ $data = json_decode($res->getBody());
+ if(isset($data->error) && !empty($data->error)) {
+ echo 'Failed: '.$data->error;
+ } else {
+ echo 'Successfully connected to the API';
+ }
+ break;
+ case 401:
+ echo 'Failed: Invalid credentials';
+ break;
+ case 404:
+ echo 'Failed: Please make sure your URL is correct and that there is a trailing slash';
+ break;
+ default:
+ echo 'Something went wrong... Code: '.$res->getStatusCode();
+ break;
+ }
+ }
+ public function executeConfig()
+ {
+ $output = '';
+ $res = $this->buildRequest('get_activity');
+ $data = json_decode($res->getBody());
+ $stream_count = $data->response->data->stream_count;
+
+ $output = '
+
+ - Stream Count'.$stream_count.'
+
+ ';
+
+ return $output;
+ }
+ public function buildRequest($endpoint)
+ {
+ $config = $this->config;
+ $url = $config->url;
+ $apikey = $config->apikey;
+
+ $url = rtrim($url, '/');
+
+ $api_url = $url.'/api/v2?apikey='.$apikey.'&cmd='.$endpoint;
+ //die( $api_url.' --- ');
+
+ $client = new Client(['http_errors' => false]);
+ $res = $client->request('GET', $api_url);
+ return $res;
+
+ }
+
+}
diff --git a/app/SupportedApps/Runeaudio.php b/app/SupportedApps/Runeaudio.php
new file mode 100644
index 00000000..a5ed561b
--- /dev/null
+++ b/app/SupportedApps/Runeaudio.php
@@ -0,0 +1,89 @@
+buildRequest('status');
+ switch($res->getStatusCode()) {
+ case 200:
+ echo 'Successfully connected to the API';
+ break;
+ case 401:
+ echo 'Failed: Invalid credentials';
+ break;
+ case 404:
+ echo 'Failed: Please make sure your URL is correct and that there is a trailing slash';
+ break;
+ default:
+ echo 'Something went wrong... Code: '.$res->getStatusCode();
+ break;
+ }
+ }
+
+ public function executeConfig()
+ {
+ $output = '';
+ $artist = '';
+ $song_title = '';
+ $res = $this->buildRequest('currentsong');
+ $array = explode("\n", $res->getBody());
+ foreach($array as $item) {
+ $item_array = explode(": ", $item);
+ if ($item_array[0] == 'Artist') {
+ $artist = $item_array[1];
+ if (strlen($artist) > 15) {
+ $artist = substr($artist,0,12).'...';
+ }
+ } elseif ($item_array[0] == 'Title') {
+ $song_title = $item_array[1];
+ if (strlen($song_title) > 15) {
+ $song_title = substr($song_title,0,12).'...';
+ }
+ }
+ }
+
+ $output = '
+
+ - Artist'.$artist.'
+ - Song'.$song_title.'
+
+ ';
+
+ return $output;
+ }
+
+ public function buildRequest($endpoint)
+ {
+ $config = $this->config;
+ $url = $config->url;
+
+ $url = rtrim($url, '/');
+
+ $api_url = $url.'/command/?cmd='.$endpoint;
+ //die( $api_url.' --- ');
+
+ $client = new Client(['http_errors' => false]);
+ $res = $client->request('GET', $api_url);
+ return $res;
+
+ }
+
+
+}
diff --git a/resources/views/supportedapps/plexpy.blade.app b/resources/views/supportedapps/plexpy.blade.app
new file mode 100644
index 00000000..e5e2fb1f
--- /dev/null
+++ b/resources/views/supportedapps/plexpy.blade.app
@@ -0,0 +1,11 @@
+{{ __('app.apps.config') }} ({{ __('app.optional') }})
+
+
+
+
+ {!! Form::text('config[apikey]', null, array('placeholder' => __('app.apps.apikey'), 'data-config' => 'apikey', 'class' => 'form-control config-item')) !!}
+
+
+
+
+
diff --git a/resources/views/supportedapps/runeaudio.blade.php b/resources/views/supportedapps/runeaudio.blade.php
new file mode 100644
index 00000000..e0a6b92f
--- /dev/null
+++ b/resources/views/supportedapps/runeaudio.blade.php
@@ -0,0 +1,21 @@
+{{ __('app.apps.config') }} ({{ __('app.optional') }})
+
+
+
+
+
+ {!! Form::hidden('config[enabled]', '0') !!}
+
+
+
+
+
+