Compare commits

..

37 Commits

Author SHA1 Message Date
Zamitto
1f000ab2b2 Merge pull request #1349 from Lianela/main
Some checks failed
Release / build (ubuntu-latest) (push) Has been cancelled
Release / build (windows-latest) (push) Has been cancelled
feat: spanish translation updated
2024-12-25 23:14:26 -03:00
Lianela
d6bd0ec221 feat: profile strings 2024-12-25 18:52:56 -06:00
Lianela
a9f8d1b42c feat: spanish translation updated
added seeding strings, updated hydra cloud and achievements strings, fixed mistake from previous commits
2024-12-25 18:38:38 -06:00
Zamitto
83e662f633 Merge pull request #1335 from hydrasources/patch-1
Some checks failed
Release / build (ubuntu-latest) (push) Has been cancelled
Release / build (windows-latest) (push) Has been cancelled
Update README.uk-UA.md
2024-12-24 16:19:47 -03:00
Zamitto
c7b924bf2f Merge pull request #1336 from hydrasources/patch-2
Update README.be.md
2024-12-24 16:19:30 -03:00
Zamitto
e0d69ccf9d Merge pull request #1337 from hydrasources/patch-3
Update README.es.md
2024-12-24 16:12:19 -03:00
Zamitto
aa4e71076d Merge pull request #1338 from hydrasources/patch-4
Update README.fr.md
2024-12-24 16:11:14 -03:00
Zamitto
eccff27739 Merge pull request #1339 from hydrasources/patch-5
Update README.de.md
2024-12-24 16:10:53 -03:00
Zamitto
601b3b0a00 Merge pull request #1340 from hydrasources/patch-6
Update README.cs.md
2024-12-24 16:10:08 -03:00
Zamitto
1ceea5d5a3 Merge pull request #1341 from hydrasources/patch-7
Update README.da.md
2024-12-24 16:09:50 -03:00
Zamitto
9c99724e7d Merge pull request #1342 from hydrasources/patch-8
Update README.nb.md
2024-12-24 16:06:29 -03:00
Zamitto
55e0f42702 Merge pull request #1343 from hydrasources/patch-9
Update README.et.md
2024-12-24 16:06:02 -03:00
hydrasources
b355930eaf Update README.et.md 2024-12-24 20:19:26 +03:00
hydrasources
57b47951a1 Update README.nb.md 2024-12-24 20:18:34 +03:00
hydrasources
4780640ed0 Update README.da.md 2024-12-24 20:17:25 +03:00
hydrasources
8b92c8fdd9 Update README.cs.md 2024-12-24 20:16:40 +03:00
hydrasources
acd98d0aad Update README.de.md 2024-12-24 20:15:56 +03:00
hydrasources
27239f848e Update README.fr.md 2024-12-24 20:15:19 +03:00
hydrasources
c4d0a8eb94 Update README.es.md 2024-12-24 20:13:52 +03:00
hydrasources
60b12b2435 Update README.be.md 2024-12-24 20:09:33 +03:00
hydrasources
1c9515516f Update README.uk-UA.md 2024-12-24 20:08:33 +03:00
JackEnx
58a89372ab Merge pull request #1334 from hydralauncher/refactor/optimize-rpc
Refactor/optimize rpc
2024-12-24 14:07:12 -03:00
JackEnx
90841bf5e4 fix: gitignore 2024-12-24 13:50:40 -03:00
JackEnx
5564644378 refactor: rpc executable objects 2024-12-24 13:48:50 -03:00
Zamitto
89bfb517fb fix: seeding causing python process to crash
Some checks are pending
Release / build (ubuntu-latest) (push) Waiting to run
Release / build (windows-latest) (push) Waiting to run
2024-12-24 02:15:27 -03:00
Chubby Granny Chaser
e1a1136e05 Merge branch 'main' of github.com:hydralauncher/hydra 2024-12-24 04:33:49 +00:00
Chubby Granny Chaser
4c6f87f6e7 chore: setting objects to expire in 3 days 2024-12-24 04:33:24 +00:00
Zamitto
3613ad156b Merge pull request #1326 from hydralauncher/fix/adding-debounce-to-search
fix: adding debounce to search
2024-12-24 01:09:12 -03:00
Zamitto
e50cb74d1d feat: move python rpc log to own file 2024-12-24 00:54:20 -03:00
Chubby Granny Chaser
36800c6368 Merge branch 'main' into fix/adding-debounce-to-search 2024-12-24 03:38:39 +00:00
Chubby Granny Chaser
f67395c94c fix: adding debounce to search 2024-12-24 03:35:29 +00:00
Zamitto
f8b9fe80fd Merge pull request #1325 from hydralauncher/fix/stop-seeding-games-that-are-not-downloaded-on-startup
fix: seeding
2024-12-24 00:35:18 -03:00
Zamitto
e211517e24 feat: revert change 2024-12-24 00:26:58 -03:00
Zamitto
538d3e5982 feat: set libtorrent flags 2024-12-24 00:23:50 -03:00
Zamitto
60e0b39f86 feat: use enum 2024-12-23 23:47:34 -03:00
Zamitto
789bccf77a chore: bump version 2024-12-23 23:45:21 -03:00
Zamitto
ce3ed6f17c fix: seeding 2024-12-23 23:44:33 -03:00
23 changed files with 168 additions and 106 deletions

1
.gitignore vendored
View File

@@ -10,3 +10,4 @@ out
ludusavi/
hydra-python-rpc/
aria2/
.python-version

View File

@@ -1 +0,0 @@
3.9.20

View File

@@ -14,7 +14,7 @@
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
@@ -27,7 +27,7 @@
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Catalogue](./screenshot.png)
![Hydra Catalogue](screenshot.png)
</div>

View File

@@ -2,7 +2,7 @@
<div align="center">
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
<h1 align="center">Hydra Launcher</h1>
@@ -14,7 +14,7 @@
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
@@ -27,7 +27,7 @@
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Katalog](./screenshot.png)
![Hydra Katalog](screenshot.png)
</div>

View File

@@ -14,7 +14,7 @@
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
@@ -26,7 +26,7 @@
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Catalogue](./screenshot.png)
![Hydra Catalogue](screenshot.png)
</div>

View File

@@ -13,7 +13,7 @@
[![build](https://img.shields.io/github/actions/workflow/status/hydralauncher/hydra/build.yml)](https://github.com/hydralauncher/hydra/actions)
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
[![pl](https://img.shields.io/badge/lang-pl-white)](README.pl.md)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
@@ -27,7 +27,7 @@
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Katalog](./screenshot.png)
![Hydra Katalog](screenshot.png)
</div>

View File

@@ -2,7 +2,7 @@
<div align="center">
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
<h1 align="center">Hydra Launcher</h1>
@@ -14,7 +14,7 @@
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
@@ -27,7 +27,7 @@
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Catalogue](./screenshot.png)
![Hydra Catalogue](screenshot.png)
</div>

View File

@@ -11,21 +11,21 @@
[![build](https://img.shields.io/github/actions/workflow/status/hydralauncher/hydra/build.yml)](https://github.com/hydralauncher/hydra/actions)
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](./README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](./README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](./README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](./README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](./README.be.md)
[![es](https://img.shields.io/badge/lang-es-red)](./README.es.md)
[![fr](https://img.shields.io/badge/lang-fr-blue)](./README.fr.md)
[![de](https://img.shields.io/badge/lang-de-black)](./README.de.md)
[![ita](https://img.shields.io/badge/lang-it-red)](./README.it.md)
[![cs](https://img.shields.io/badge/lang-cs-purple)](./README.cs.md)
[![da](https://img.shields.io/badge/lang-da-red)](./README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](./README.nb.md)
[![ee](https://img.shields.io/badge/lang-et-blue.svg)](./README.et.md)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
[![es](https://img.shields.io/badge/lang-es-red)](README.es.md)
[![fr](https://img.shields.io/badge/lang-fr-blue)](README.fr.md)
[![de](https://img.shields.io/badge/lang-de-black)](README.de.md)
[![ita](https://img.shields.io/badge/lang-it-red)](README.it.md)
[![cs](https://img.shields.io/badge/lang-cs-purple)](README.cs.md)
[![da](https://img.shields.io/badge/lang-da-red)](README.da.md)
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![ee](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Kataloog](./screenshot.png)
![Hydra Kataloog](screenshot.png)
</div>

View File

@@ -2,7 +2,7 @@
<div align="center">
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
<h1 align="center">Hydra Launcher</h1>
@@ -14,7 +14,7 @@
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
@@ -27,7 +27,7 @@
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Catalogue Hydra](./screenshot.png)
![Catalogue Hydra](screenshot.png)
</div>

View File

@@ -2,7 +2,7 @@
<div align="center">
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
<h1 align="center">Hydra Launcher</h1>
@@ -14,7 +14,7 @@
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
@@ -26,7 +26,7 @@
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Catalogue](./screenshot.png)
![Hydra Catalogue](screenshot.png)
</div>

View File

@@ -2,7 +2,7 @@
<div align="center">
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
<h1 align="center">Hydra Launcher</h1>
@@ -14,7 +14,7 @@
[![release](https://img.shields.io/github/package-json/v/hydralauncher/hydra)](https://github.com/hydralauncher/hydra/releases)
[![pt-BR](https://img.shields.io/badge/lang-pt--BR-green.svg)](README.pt-BR.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](README.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](../README.md)
[![ru](https://img.shields.io/badge/lang-ru-yellow.svg)](README.ru.md)
[![uk-UA](https://img.shields.io/badge/lang-uk--UA-blue)](README.uk-UA.md)
[![be](https://img.shields.io/badge/lang-be-orange)](README.be.md)
@@ -27,7 +27,7 @@
[![nb](https://img.shields.io/badge/lang-nb-blue)](README.nb.md)
[![et](https://img.shields.io/badge/lang-et-blue.svg)](README.et.md)
![Hydra Catalogue](./screenshot.png)
![Hydra Catalogue](screenshot.png)
</div>

View File

@@ -1,6 +1,6 @@
{
"name": "hydralauncher",
"version": "3.1.0",
"version": "3.1.2",
"description": "Hydra",
"main": "./out/main/index.js",
"author": "Los Broxas",

View File

@@ -27,18 +27,27 @@ if start_download_payload:
if initial_download['url'].startswith('magnet'):
torrent_downloader = TorrentDownloader(torrent_session)
downloads[initial_download['game_id']] = torrent_downloader
torrent_downloader.start_download(initial_download['url'], initial_download['save_path'], "")
try:
torrent_downloader.start_download(initial_download['url'], initial_download['save_path'], "")
except Exception as e:
print("Error starting torrent download", e)
else:
http_downloader = HttpDownloader()
downloads[initial_download['game_id']] = http_downloader
http_downloader.start_download(initial_download['url'], initial_download['save_path'], initial_download.get('header'))
try:
http_downloader.start_download(initial_download['url'], initial_download['save_path'], initial_download.get('header'))
except Exception as e:
print("Error starting http download", e)
if start_seeding_payload:
initial_seeding = json.loads(urllib.parse.unquote(start_seeding_payload))
for seed in initial_seeding:
torrent_downloader = TorrentDownloader(torrent_session)
torrent_downloader = TorrentDownloader(torrent_session, lt.torrent_flags.upload_mode)
downloads[seed['game_id']] = torrent_downloader
torrent_downloader.start_download(seed['url'], seed['save_path'], "")
try:
torrent_downloader.start_download(seed['url'], seed['save_path'], "")
except Exception as e:
print("Error starting seeding", e)
def validate_rpc_password():
"""Middleware to validate RPC password."""
@@ -156,7 +165,7 @@ def action():
if downloader:
downloader.cancel_download()
elif action == 'resume_seeding':
torrent_downloader = TorrentDownloader(torrent_session)
torrent_downloader = TorrentDownloader(torrent_session, lt.torrent_flags.upload_mode)
downloads[game_id] = torrent_downloader
torrent_downloader.start_download(data['url'], data['save_path'], "")
elif action == 'pause_seeding':

View File

@@ -1,9 +1,10 @@
import libtorrent as lt
class TorrentDownloader:
def __init__(self, torrent_session):
def __init__(self, torrent_session, flags = lt.torrent_flags.auto_managed):
self.torrent_handle = None
self.session = torrent_session
self.flags = flags
self.trackers = [
"udp://tracker.opentrackr.org:1337/announce",
"http://tracker.opentrackr.org:1337/announce",
@@ -102,9 +103,8 @@ class TorrentDownloader:
]
def start_download(self, magnet: str, save_path: str, header: str):
params = {'url': magnet, 'save_path': save_path, 'trackers': self.trackers}
params = {'url': magnet, 'save_path': save_path, 'trackers': self.trackers, 'flags': self.flags}
self.torrent_handle = self.session.add_torrent(params)
self.torrent_handle.set_flags(lt.torrent_flags.auto_managed)
self.torrent_handle.resume()
def pause_download(self):

View File

@@ -36,6 +36,8 @@ fs.readdir(dist, async (err, files) => {
Bucket: process.env.S3_BUILDS_BUCKET_NAME,
Key: fileName,
Body: fs.createReadStream(path.resolve(dist, file)),
// 3 days
Expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 3),
});
await s3.send(command);

View File

@@ -50,7 +50,7 @@
"developers": "Desarrolladores",
"genres": "Géneros",
"tags": "Marcadores",
"publishers": "Distribuidoras",
"publishers": "Editores",
"download_sources": "Fuentes de descarga",
"result_count": "{{resultCount}} resultados",
"filter_count": "{{filterCount}} disponibles",
@@ -175,7 +175,7 @@
"backup_from": "Copia de seguridad de {{date}}",
"custom_backup_location_set": "Se configuró la carpeta de copia de seguridad",
"clear": "Limpiar",
"no_directory_selected": "No se seleccionó un directório"
"no_directory_selected": "No se seleccionó un directorio"
},
"activation": {
"title": "Activar Hydra",
@@ -208,7 +208,11 @@
"queued": "En cola",
"no_downloads_title": "Esto está tan... vacío",
"no_downloads_description": "No has descargado nada con Hydra... aún, ¡pero nunca es tarde para comenzar!.",
"checking_files": "Verificando archivos…"
"checking_files": "Verificando archivos…",
"seeding": "Seeding",
"stop_seeding": "Detener seeding",
"resume_seeding": "Continuar seeding",
"options": "Gestionar"
},
"settings": {
"downloads_path": "Ruta de descarga",
@@ -265,7 +269,9 @@
"user_unblocked": "El usuario ha sido desbloqueado",
"enable_achievement_notifications": "Cuando un logro se desbloquea",
"launch_minimized": "Iniciar Hydra minimizado",
"disable_nsfw_alert": "Desactivar alerta NSFW"
"disable_nsfw_alert": "Desactivar alerta NSFW",
"seed_after_download_complete": "Realizar seeding después de que se completa la descarga",
"show_hidden_achievement_description": "Ocultar descripción de logros ocultos antes de desbloquearlos"
},
"notifications": {
"download_complete": "Descarga completada",
@@ -366,7 +372,16 @@
"upload_banner": "Subir un banner",
"uploading_banner": "Subiendo banner…",
"background_image_updated": "Imagen de fondo actualizada",
"playing": "Jugando {{game}}"
"playing": "Jugando {{game}}",
"achievements": "logros",
"achievements_unlocked": "Logros desbloqueados",
"earned_points": "Puntos Obtenidos",
"show_achievements_on_profile": "Mostrar tus logros en tu perfil",
"show_points_on_profile": "Mostrar tus puntos obtenidos en tu perfil",
"games": "Juegos",
"ranking_updated_weekly": "El Ranking se actualiza semanalmente",
"stats": "Estadísticas",
"top_percentile": "Top {{percentile}}%"
},
"achievement": {
"achievement_unlocked": "Logro desbloqueado",
@@ -376,7 +391,12 @@
"subscription_needed": "Se necesita una suscripción a Hydra Cloud necesita para ver este contenido",
"new_achievements_unlocked": "Desbloqueados {{achievementCount}} nuevos logros de {{gameCount}} juegos",
"achievement_progress": "{{unlockedCount}}/{{totalCount}} logros",
"achievements_unlocked_for_game": "Se han desbloqueado {{achievementCount}} nuevos logros de {{gameTitle}}"
"achievements_unlocked_for_game": "Se han desbloqueado {{achievementCount}} nuevos logros de {{gameTitle}}",
"hidden_achievement_tooltip": "Este es un logro oculto",
"achievement_earn_points": "Obtén {{points}} puntos con este logro",
"earned_points": "Puntos obtenidos:",
"available_points": "Puntos disponibles:",
"how_to_earn_achievements_points": "¿Cómo obtener puntos de logros?"
},
"hydra_cloud": {
"subscription_tour_title": "Suscripción Hydra Cloud",
@@ -386,6 +406,9 @@
"animated_profile_picture": "Fotos de perfil animadas",
"premium_support": "Soporte Premium",
"show_and_compare_achievements": "Muestra y compara tus logros con otros usuarios",
"animated_profile_banner": "Fondo de perfil animado"
"animated_profile_banner": "Fondo de perfil animado",
"hydra_cloud": "Hydra Cloud",
"hydra_cloud_feature_found": "¡Has descubierto una característica de Hydra Cloud!",
"learn_more": "Aprender más"
}
}

View File

@@ -1,6 +1,7 @@
import { registerEvent } from "../register-event";
import { gameRepository } from "../../repository";
import { DownloadManager } from "@main/services";
import { Downloader } from "@shared";
const resumeGameSeed = async (
_event: Electron.IpcMainInvokeEvent,
@@ -10,7 +11,7 @@ const resumeGameSeed = async (
where: {
id: gameId,
isDeleted: false,
downloader: 1,
downloader: Downloader.Torrent,
progress: 1,
},
});

View File

@@ -9,6 +9,8 @@ import { RealDebridClient } from "./services/download/real-debrid";
import { HydraApi } from "./services/hydra-api";
import { uploadGamesBatch } from "./services/library-sync";
import { Aria2 } from "./services/aria2";
import { Downloader } from "@shared";
import { IsNull, Not } from "typeorm";
const loadState = async (userPreferences: UserPreferences | null) => {
import("./events");
@@ -37,8 +39,9 @@ const loadState = async (userPreferences: UserPreferences | null) => {
const seedList = await gameRepository.find({
where: {
shouldSeed: true,
downloader: 1,
downloader: Downloader.Torrent,
progress: 1,
uri: Not(IsNull()),
},
});

View File

@@ -100,8 +100,6 @@ export class DownloadManager {
public static async watchDownloads() {
const status = await this.getDownloadStatus();
// status = await RealDebridDownloader.getStatus();
if (status) {
const { gameId, progress } = status;
const game = await gameRepository.findOne({

View File

@@ -31,6 +31,6 @@ log.errorHandler.startCatching({
log.initialize();
export const pythonInstanceLogger = log.scope("python-instance");
export const pythonRpcLogger = log.scope("python-rpc");
export const logger = log.scope("main");
export const achievementsLogger = log.scope("achievements");

View File

@@ -21,6 +21,7 @@ export const gamesPlaytime = new Map<
interface ExecutableInfo {
name: string;
os: string;
exe: string;
}
interface GameExecutables {
@@ -30,47 +31,65 @@ interface GameExecutables {
const TICKS_TO_UPDATE_API = 120;
let currentTick = 1;
const gameExecutables = (
await axios
.get(
import.meta.env.MAIN_VITE_EXTERNAL_RESOURCES_URL +
"/game-executables.json"
)
.catch(() => {
return { data: {} };
})
).data as GameExecutables;
const isWindowsPlatform = process.platform === "win32";
const isLinuxPlatform = process.platform === "linux";
const getGameExecutables = async () => {
const gameExecutables = (
await axios
.get(
import.meta.env.MAIN_VITE_EXTERNAL_RESOURCES_URL +
"/game-executables.json"
)
.catch(() => {
return { data: {} };
})
).data as GameExecutables;
Object.keys(gameExecutables).forEach((key) => {
gameExecutables[key] = gameExecutables[key]
.filter((executable) => {
if (isWindowsPlatform) {
return executable.os === "win32";
} else if (isLinuxPlatform) {
return executable.os === "linux" || executable.os === "win32";
}
return false;
})
.map((executable) => {
return {
name: isWindowsPlatform
? executable.name.replace(/\//g, "\\")
: executable.name,
os: executable.os,
exe: executable.name.slice(executable.name.lastIndexOf("/") + 1),
};
});
});
return gameExecutables;
};
const gameExecutables = await getGameExecutables();
const findGamePathByProcess = (
processMap: Map<string, Set<string>>,
gameId: string
) => {
const executables = gameExecutables[gameId].filter((info) => {
if (process.platform === "linux" && info.os === "linux") return true;
return info.os === "win32";
});
const executables = gameExecutables[gameId];
for (const executable of executables) {
const exe = executable.name.slice(executable.name.lastIndexOf("/") + 1);
if (!exe) continue;
const pathSet = processMap.get(exe);
const pathSet = processMap.get(executable.exe);
if (pathSet) {
const executableName =
process.platform === "win32"
? executable.name.replace(/\//g, "\\")
: executable.name;
pathSet.forEach((path) => {
if (path.toLowerCase().endsWith(executableName)) {
if (path.toLowerCase().endsWith(executable.name)) {
gameRepository.update(
{ objectID: gameId, shop: "steam" },
{ executablePath: path }
);
if (process.platform === "linux") {
if (isLinuxPlatform) {
exec(commands.findWineDir, (err, out) => {
if (err) return;
@@ -105,7 +124,7 @@ const getSystemProcessMap = async () => {
map.set(key, currentSet.add(value));
});
if (process.platform === "linux") {
if (isLinuxPlatform) {
await new Promise((res) => {
exec(commands.findWineExecutables, (err, out) => {
if (err) {
@@ -152,7 +171,6 @@ export const watchProcesses = async () => {
for (const game of games) {
const executablePath = game.executablePath;
if (!executablePath) {
if (gameExecutables[game.objectID]) {
findGamePathByProcess(processMap, game.objectID);
@@ -161,10 +179,7 @@ export const watchProcesses = async () => {
}
const executable = executablePath
.slice(
executablePath.lastIndexOf(process.platform === "win32" ? "\\" : "/") +
1
)
.slice(executablePath.lastIndexOf(isWindowsPlatform ? "\\" : "/") + 1)
.toLowerCase();
const hasProcess = processMap.get(executable)?.has(executablePath);

View File

@@ -5,7 +5,7 @@ import fs from "node:fs";
import path from "node:path";
import crypto from "node:crypto";
import { logger } from "./logger";
import { pythonRpcLogger } from "./logger";
import { Readable } from "node:stream";
import { app, dialog } from "electron";
@@ -39,7 +39,7 @@ export class PythonRPC {
if (!readable) return;
readable.setEncoding("utf-8");
readable.on("data", logger.log);
readable.on("data", pythonRpcLogger.log);
}
public static spawn(
@@ -100,7 +100,7 @@ export class PythonRPC {
public static kill() {
if (this.pythonProcess) {
logger.log("Killing python process");
pythonRpcLogger.log("Killing python process");
this.pythonProcess.kill();
this.pythonProcess = null;
}

View File

@@ -20,6 +20,7 @@ import { Pagination } from "./pagination";
import { useCatalogue } from "@renderer/hooks/use-catalogue";
import { GameItem } from "./game-item";
import { FilterItem } from "./filter-item";
import { debounce } from "lodash-es";
const filterCategoryColors = {
genres: "hsl(262deg 50% 47%)",
@@ -58,26 +59,36 @@ export default function Catalogue() {
const { getRepacksForObjectId } = useRepacks();
const debouncedSearch = useRef(
debounce(async (filters, pageSize, offset) => {
const abortController = new AbortController();
abortControllerRef.current = abortController;
const response = await window.electron.searchGames(
filters,
pageSize,
offset
);
if (abortController.signal.aborted) return;
setResults(response.edges);
setItemsCount(response.count);
setIsLoading(false);
}, 500)
).current;
useEffect(() => {
setResults([]);
setIsLoading(true);
abortControllerRef.current?.abort();
const abortController = new AbortController();
abortControllerRef.current = abortController;
debouncedSearch(filters, PAGE_SIZE, (page - 1) * PAGE_SIZE);
window.electron
.searchGames(filters, PAGE_SIZE, (page - 1) * PAGE_SIZE)
.then((response) => {
if (abortController.signal.aborted) {
return;
}
setResults(response.edges);
setItemsCount(response.count);
setIsLoading(false);
});
}, [filters, page, dispatch]);
return () => {
debouncedSearch.cancel();
};
}, [filters, page, debouncedSearch]);
useEffect(() => {
downloadSourcesTable.toArray().then((sources) => {