ajout heimdall

This commit is contained in:
2025-01-01 11:24:01 +01:00
parent f8be42e486
commit c52f60fca9
1477 changed files with 15692 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<?php namespace App\SupportedApps\Jellyfin;
class Jellyfin extends \App\SupportedApps implements \App\EnhancedApps
{
public $config;
function __construct()
{
}
public function test()
{
$test = parent::appTest(
$this->url("System/Info/Public"),
$this->getAttrs()
);
echo $test->status;
}
public function livestats()
{
$status = "inactive";
$res = parent::execute($this->url("Items/Counts"), $this->getAttrs());
$result = json_decode($res->getBody());
$details = ["visiblestats" => []];
foreach ($this->config->availablestats as $stat) {
$newstat = new \stdClass();
$newstat->title = self::getAvailableStats()[$stat];
$newstat->value = $result->{$stat};
$details["visiblestats"][] = $newstat;
}
return parent::getLiveStats($status, $details);
}
public function url($endpoint)
{
$api_url = parent::normaliseurl($this->config->url) . $endpoint;
return $api_url;
}
private function getAttrs()
{
return [
"headers" => [
"X-MediaBrowser-Token" => $this->config->password,
],
];
}
public static function getAvailableStats()
{
return [
"MovieCount" => "Movies",
"SeriesCount" => "Series",
"EpisodeCount" => "Episodes",
"ArtistCount" => "Artists",
"ProgramCount" => "Programs",
"TrailerCount" => "Trailers",
"SongCount" => "Songs",
"AlbumCount" => "Albums",
"MusicVideoCount" => "MusicVideos",
"BoxSetCount" => "BoxSets",
"BookCount" => "Books",
"ItemCount" => "Items",
];
}
}

View File

@@ -0,0 +1,10 @@
{
"appid": "3e0a7f109bd760b9474c78cb652e8c3e82669226",
"name": "Jellyfin",
"website": "https://jellyfin.github.io",
"license": "GNU General Public License v2.0 only",
"description": "Jellyfin is the Free Software Media System that puts you in control of managing and streaming your media. There are no strings attached, no premium licenses or features, and no hidden agendas.",
"enhanced": true,
"tile_background": "dark",
"icon": "jellyfin.svg"
}

View File

@@ -0,0 +1,18 @@
<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">
<label>{{ __('app.apps.password') }} (secret token)</label>
{!! Form::input('password', 'config[password]', '', ['placeholder' => __('app.apps.password'), 'data-config' => 'password', 'class' => 'form-control config-item']) !!}
</div>
<div class="input">
<label>Stats to show</label>
{!! Form::select('config[availablestats][]', App\SupportedApps\Jellyfin\Jellyfin::getAvailableStats(), isset($item) ? $item->getConfig()->availablestats ?? null : null, ['multiple' => 'multiple']) !!}
</div>
<div class="input">
<button style="margin-top: 32px;" class="btn test" id="test_config">Test</button>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -0,0 +1,8 @@
<ul class="livestats">
@foreach ($visiblestats as $stat)
<li>
<span class="title">{!! $stat->title !!}</span>
<strong>{!! $stat->value !!}</strong>
</li>
@endforeach
</ul>