diff --git a/.gitignore b/.gitignore index ebbb1320a0..44be311515 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Vaultwarden/Thumbs.db BrotherPrinter/Thumbs.db Rustdesk/Thumbs.db .idea +.DS_Store diff --git a/RomM/RomM.php b/RomM/RomM.php new file mode 100644 index 0000000000..5addf9c442 --- /dev/null +++ b/RomM/RomM.php @@ -0,0 +1,51 @@ +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", + ]; + } +} diff --git a/RomM/app.json b/RomM/app.json new file mode 100644 index 0000000000..a7e620699f --- /dev/null +++ b/RomM/app.json @@ -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" +} diff --git a/RomM/config.blade.php b/RomM/config.blade.php new file mode 100644 index 0000000000..b06903d53d --- /dev/null +++ b/RomM/config.blade.php @@ -0,0 +1,15 @@ +