Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Vaultwarden/Thumbs.db
BrotherPrinter/Thumbs.db
Rustdesk/Thumbs.db
.idea
.DS_Store
51 changes: 51 additions & 0 deletions RomM/RomM.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace App\SupportedApps\RomM;

class RomM extends \App\SupportedApps implements \App\EnhancedApps
{
public $config;

public function __construct()
{
}

public function test()
{
$test = parent::appTest($this->url('api/stats'));
echo $test->status;
}

public function livestats()
{
$status = "inactive";
$res = parent::execute($this->url('api/stats'));
$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;
}

public static function getAvailableStats()
{
return [
"PLATFORMS" => "Platforms",
"ROMS" => "Total ROMs",
"SAVES" => "Saves",
"STATES" => "States",
"SCREENSHOTS" => "Screenshots",
"FILESIZE" => "Total Filesize",
];
}
}
10 changes: 10 additions & 0 deletions RomM/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"appid": "2a3931f4ca016a139bcf5a97c85ee0a67825fe43",
"name": "RomM",
"website": "https://romm.app",
"license": "Affero General Public License v3.0",
"description": "RomM is your beautiful, powerful, self-hosted rom manager. Scan, enrich, and browse your game collection with a clean and responsive interface. With support for multiple platforms, various naming schemes and custom tags, RomM is a must-have for anyone who plays on emulators.",
"enhanced": true,
"tile_background": "dark",
"icon": "romm.png"
}
15 changes: 15 additions & 0 deletions RomM/config.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<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>Stats to show</label>
{!! Form::select('config[availablestats][]', App\SupportedApps\RomM\RomM::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>

8 changes: 8 additions & 0 deletions RomM/livestats.blade.php
Original file line number Diff line number Diff line change
@@ -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>
Binary file added RomM/romm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.