Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More friendly experience when presenting repack options #270

Merged
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
02c4f0a
feat: Add repack language codes to translation files
ChristoferMendes May 10, 2024
a0344ea
feat(events): Add new event for getting magnet data
ChristoferMendes May 10, 2024
08c4906
feat: Add new Tag component with styling for tags
ChristoferMendes May 10, 2024
1872ff1
feat: Add tooltip component with styles and visibility logic
ChristoferMendes May 10, 2024
58693fd
feat: Add SeedersAndPeers component with skeleton loader
ChristoferMendes May 10, 2024
2662ba3
style: Add styling for tags container in repacks modal
ChristoferMendes May 10, 2024
ada218c
feat: Add functions for multiplayer repack, multi-language support, a…
ChristoferMendes May 10, 2024
06ed5e0
feat: Add new functionality to display repack language and seeders/pe…
ChristoferMendes May 10, 2024
09bd7dc
feat: Add lucide-react package to dependencies
ChristoferMendes May 10, 2024
b84df28
feat: Add openWebTorrent service for fetching seeders and peers
ChristoferMendes May 10, 2024
92f35ba
refactor: Update function calls from savePage to saveRepacks in multi…
ChristoferMendes May 10, 2024
ff6a204
feat: Add getMagnetData function to global declaration
ChristoferMendes May 10, 2024
8f6922f
feat: Add multi-language and multiplayer tags in RepacksModal
ChristoferMendes May 10, 2024
e55d418
refactor: Simplify code by removing unnecessary try-catch block
ChristoferMendes May 12, 2024
dce700b
Merge branch 'main' into feature/better-repack-modal
ChristoferMendes May 12, 2024
2f0cd24
refactor: Improve the structure of useMagnetData function
ChristoferMendes May 12, 2024
0aa36c5
fix: update tag styles to match variables
ChristoferMendes May 12, 2024
5f468d5
style: Update translation keys for "multi_player" to "multiplayer" in…
ChristoferMendes May 12, 2024
02417dd
style: update tag component CSS formatting
ChristoferMendes May 12, 2024
4616f69
refactor: Update function names in repack tracker to use 'savePage' i…
ChristoferMendes May 12, 2024
6b9f902
feat: Replace OpenWebTorrent service with WebTorrentData service
ChristoferMendes May 13, 2024
27bff9d
fix: Replace getMagnetData with getMagnetHealth in references and imp…
ChristoferMendes May 13, 2024
23ab982
feat: Add webtorrent-health package to dependencies
ChristoferMendes May 13, 2024
0333282
refactor: Update import paths and improve async function in get-magne…
ChristoferMendes May 13, 2024
6053b7c
refactor: Remove unused "repack_language_code" translations from mult…
ChristoferMendes May 13, 2024
f9343ca
style: Remove lucide-react icons and replace them with SVG components
ChristoferMendes May 13, 2024
c7da83c
Merge branch 'main' into feature/better-repack-modal
ChristoferMendes May 13, 2024
713392e
style: Remove unnecessary code in translation.json
ChristoferMendes May 13, 2024
e6b6239
fix: solve merge conflict markers
ChristoferMendes May 13, 2024
f2af65d
style: Update formatting in various files
ChristoferMendes May 13, 2024
26db889
refactor: Update getRepackLanguageBasedOnRepacker function parameters…
ChristoferMendes May 13, 2024
82edc6d
Merge branch 'main' into feature/better-repack-modal
ChristoferMendes May 13, 2024
0d089bb
Merge branch 'main' into feature/better-repack-modal
ChristoferMendes May 13, 2024
81ea790
Merge branch 'main' into feature/better-repack-modal
zamitto May 13, 2024
1c56227
feat(searcher): Add repacker check to isMultiplayerRepack function
ChristoferMendes May 14, 2024
4e9e9de
style: Remove unnecessary whitespace and newline in translation.json
ChristoferMendes May 14, 2024
9c26155
feat: Add toCapitalize function for capitalizing strings
ChristoferMendes May 14, 2024
95e8023
Merge branch 'main' of github.com:ChristoferMendes/hydra into feature…
ChristoferMendes May 14, 2024
7bdf7f8
Merge remote-tracking branch 'upstream/main' into feature/better-repa…
ChristoferMendes May 14, 2024
04a5dbb
Merge branch 'main' into feature/better-repack-modal
zamitto May 15, 2024
7a2b693
refactor: Improve error handling and retry logic in getSeedersAndPeer…
ChristoferMendes May 15, 2024
539f444
feat(webTorrentHealth): update recursive function with a loop
ChristoferMendes May 16, 2024
38d652c
Merge branch 'main' into feature/better-repack-modal
ChristoferMendes May 16, 2024
d8937b3
Merge branch 'main' into feature/better-repack-modal
ChristoferMendes May 17, 2024
d924c64
Update web-torrent-data.ts
zamitto May 18, 2024
6fd38df
Merge branch 'main' into feature/better-repack-modal
zamitto May 18, 2024
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: 0 additions & 1 deletion README.pt-BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
[![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)


![Hydra Catalogue](./docs/screenshot.png)

</div>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"react-router-dom": "^6.22.3",
"typeorm": "^0.3.20",
"user-agents": "^1.1.193",
"webtorrent-health": "^1.2.0",
"winston": "^3.13.0",
"yaml": "^2.4.1"
},
Expand Down
110 changes: 55 additions & 55 deletions src/locales/ar/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,62 +55,62 @@
"remove_from_list": "إزالة",
"space_left_on_disk": "{{space}} متبقية على القرص",
"eta": "الوقت المتبقي {{eta}}",
"downloading_metadata": "جاري تنزيل البيانات الوصفية...",
"checking_files": "جاري التحقق من الملفات...",
"filter": "تصفية حزم إعادة التجميع",
"requirements": "متطلبات النظام",
"minimum": "الحد الأدنى",
"recommended": "موصى به",
"no_minimum_requirements": "{{title}} لا تتوفر معلومات عن الحد الأدنى للمتطلبات",
"no_recommended_requirements": "{{title}} لا تتوفر معلومات عن المتطلبات الموصى بها",
"paused_progress": "{{progress}} (متوقف)",
"release_date": "تم الإصدار في {{date}}",
"publisher": "نشر بواسطة {{publisher}}",
"copy_link_to_clipboard": "نسخ الرابط",
"copied_link_to_clipboard": "تم نسخ الرابط",
"hours": "ساعات",
"minutes": "دقائق",
"amount_hours": "{{amount}} ساعات",
"amount_minutes": "{{amount}} دقائق",
"accuracy": "دقة {{accuracy}}%",
"add_to_library": "إضافة إلى المكتبة",
"remove_from_library": "إزالة من المكتبة",
"no_downloads": "لا توجد تنزيلات متاحة",
"play_time": "تم اللعب لمدة {{amount}}",
"last_time_played": "آخر مرة لعبت {{period}}",
"not_played_yet": "لم تلعب {{title}} بعد",
"next_suggestion": "الاقتراح التالي",
"play": "لعب",
"deleting": "جاري حذف المثبت...",
"close": "إغلاق",
"playing_now": "قيد التشغيل الآن",
"change": "تغيير",
"repacks_modal_description": "اختر الحزمة التي تريد تنزيلها",
"select_folder_hint": "لتغيير المجلد الافتراضي، انتقل إلى الإعدادات",
"download_now": "تنزيل الآن",
"installation_instructions": "إرشادات التثبيت",
"installation_instructions_description": "هناك خطوات إضافية مطلوبة لتثبيت هذه اللعبة",
"online_fix_instruction": "تتطلب ألعاب OnlineFix كلمة مرور لاستخراجها. عند الحاجة، استخدم كلمة المرور التالية:",
"dodi_installation_instruction": "عند فتح مثبت DODI، اضغط على مفتاح التشغيل لأعلى <0 /> لبدء عملية التثبيت:",
"dont_show_it_again": "لا تعرضها مرة أخرى",
"copy_to_clipboard": "نسخ",
"copied_to_clipboard": "تم النسخ",
"got_it": "حسنأ",
"no_shop_details": "لم يتم استرداد تفاصيل المتجر.",
"download_options": "خيارات التنزيل",
"download_path": "مسار التنزيل",
"previous_screenshot": "لقطة الشاشة السابقة",
"next_screenshot": "لقطة الشاشة التالية",
"screenshot": "لقطة شاشة {{number}}",
"open_screenshot": "افتح لقطة الشاشة {{number}}"
"downloading_metadata": "جاري تنزيل البيانات الوصفية...",
"checking_files": "جاري التحقق من الملفات...",
"filter": "تصفية حزم إعادة التجميع",
"requirements": "متطلبات النظام",
"minimum": "الحد الأدنى",
"recommended": "موصى به",
"no_minimum_requirements": "{{title}} لا تتوفر معلومات عن الحد الأدنى للمتطلبات",
"no_recommended_requirements": "{{title}} لا تتوفر معلومات عن المتطلبات الموصى بها",
"paused_progress": "{{progress}} (متوقف)",
"release_date": "تم الإصدار في {{date}}",
"publisher": "نشر بواسطة {{publisher}}",
"copy_link_to_clipboard": "نسخ الرابط",
"copied_link_to_clipboard": "تم نسخ الرابط",
"hours": "ساعات",
"minutes": "دقائق",
"amount_hours": "{{amount}} ساعات",
"amount_minutes": "{{amount}} دقائق",
"accuracy": "دقة {{accuracy}}%",
"add_to_library": "إضافة إلى المكتبة",
"remove_from_library": "إزالة من المكتبة",
"no_downloads": "لا توجد تنزيلات متاحة",
"play_time": "تم اللعب لمدة {{amount}}",
"last_time_played": "آخر مرة لعبت {{period}}",
"not_played_yet": "لم تلعب {{title}} بعد",
"next_suggestion": "الاقتراح التالي",
"play": "لعب",
"deleting": "جاري حذف المثبت...",
"close": "إغلاق",
"playing_now": "قيد التشغيل الآن",
"change": "تغيير",
"repacks_modal_description": "اختر الحزمة التي تريد تنزيلها",
"select_folder_hint": "لتغيير المجلد الافتراضي، انتقل إلى الإعدادات",
"download_now": "تنزيل الآن",
"installation_instructions": "إرشادات التثبيت",
"installation_instructions_description": "هناك خطوات إضافية مطلوبة لتثبيت هذه اللعبة",
"online_fix_instruction": "تتطلب ألعاب OnlineFix كلمة مرور لاستخراجها. عند الحاجة، استخدم كلمة المرور التالية:",
"dodi_installation_instruction": "عند فتح مثبت DODI، اضغط على مفتاح التشغيل لأعلى <0 /> لبدء عملية التثبيت:",
"dont_show_it_again": "لا تعرضها مرة أخرى",
"copy_to_clipboard": "نسخ",
"copied_to_clipboard": "تم النسخ",
"got_it": "حسنأ",
"no_shop_details": "لم يتم استرداد تفاصيل المتجر.",
"download_options": "خيارات التنزيل",
"download_path": "مسار التنزيل",
"previous_screenshot": "لقطة الشاشة السابقة",
"next_screenshot": "لقطة الشاشة التالية",
"screenshot": "لقطة شاشة {{number}}",
"open_screenshot": "افتح لقطة الشاشة {{number}}"
},
"activation": {
"title": "تفعيل هايدرا",
"installation_id": "معرف التثبيت:",
"enter_activation_code": "أدخل رمز التفعيل الخاص بك",
"message": "إذا كنت لا تعرف أين تسأل عن هذا ، فلا يجب أن يكون لديك هذا.",
"title": "تفعيل هايدرا",
"installation_id": "معرف التثبيت:",
"enter_activation_code": "أدخل رمز التفعيل الخاص بك",
"message": "إذا كنت لا تعرف أين تسأل عن هذا ، فلا يجب أن يكون لديك هذا.",
"activate": "تفعيل",
"loading": "جار التحميل…"
"loading": "جار التحميل…"
},
"downloads": {
"resume": "استئناف",
Expand Down Expand Up @@ -146,7 +146,7 @@
"telemetry": "القياس عن بعد",
"telemetry_description": "تفعيل إحصائيات الاستخدام مجهولة المصدر",
"real_debrid_api_token_label": "رمز واجهة برمجة التطبيقات (API) لـReal Debrid ",
"quit_app_instead_hiding": "إنهاء هايدرا بدلاً من التصغير الى شريط الحالة",
"quit_app_instead_hiding": "إنهاء هايدرا بدلاً من التصغير الى شريط الحالة",
"launch_with_system": "تشغيل هايدرا عند بدء تشغيل النظام",
"general": "عام",
"behavior": "السلوك",
Expand Down Expand Up @@ -177,4 +177,4 @@
"modal": {
"close": "زر إغلاق"
}
}
}
2 changes: 2 additions & 0 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"copy_to_clipboard": "Copy",
"copied_to_clipboard": "Copied",
"got_it": "Got it",
"multi_language": "Multi Language",
"multiplayer": "Multi Player",
"no_shop_details": "Could not retrieve shop details.",
"download_options": "Download options",
"download_path": "Download path",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
"dodi_installation_instruction": "Cuando abras el instalador de DODI, presiona la tecla hacia arriba del teclado <0 /> para iniciar el proceso de instalación:",
"dont_show_it_again": "No mostrar de nuevo",
"copy_to_clipboard": "Copiar",
"copied_to_clipboard": "Copiado"
"copied_to_clipboard": "Copiado",
"multi_language": "Multi Idioma",
"multiplayer": "Multijugador"
},
"activation": {
"title": "Activar Hydra",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@
"close": "Fermer",
"deleting": "Suppression du programme d'installation…",
"playing_now": "Jeu en cours",
"last_time_played": "Dernièrement joué {{période}}"
"last_time_played": "Dernièrement joué {{période}}",
"multi_language": "Multilingue",
"multiplayer": "Multijoueur"
},
"activation": {
"title": "Activer Hydra",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/hu/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@
"repacks_modal_description": "Choose the repack you want to download",
"downloads_path": "Letöltések helye",
"select_folder_hint": "Ahhoz, hogy megváltoztasd a helyet, hozzákell férned a",
"download_now": "Töltsd le most"
"download_now": "Töltsd le most",
"multi_language": "Többnyelvű",
"multiplayer": "Többjátékos"
},
"activation": {
"title": "Hydra Aktiválása",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/it/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@
"dont_show_it_again": "Non mostrarlo più",
"copy_to_clipboard": "Copia",
"copied_to_clipboard": "Copiato",
"got_it": "Capito"
"got_it": "Capito",
"multi_language": "Multilingua",
"multiplayer": "Multigiocatore"
},
"activation": {
"title": "Attiva Hydra",
Expand Down
5 changes: 4 additions & 1 deletion src/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@
"repacks_modal_description": "Wybierz repack, który chcesz pobrać",
"downloads_path": "Ścieżka pobierania",
"select_folder_hint": "Aby zmienić domyślny folder, przejdź do",
"download_now": "Pobierz teraz"
"settings": "Ustawienia Hydra",
"download_now": "Pobierz teraz",
"multi_language": "Wielojęzyczny",
"multiplayer": "Wieloosobowy"
},
"activation": {
"title": "Aktywuj Hydra",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
"copy_to_clipboard": "Copiar",
"copied_to_clipboard": "Copiado",
"got_it": "Entendi",
"multi_language": "Multi Idioma",
"multiplayer": "Multijogador",
"no_shop_details": "Não foi possível obter os detalhes da loja.",
"download_options": "Opções de download",
"download_path": "Diretório de download",
Expand Down
2 changes: 2 additions & 0 deletions src/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"copy_to_clipboard": "Копировать",
"copied_to_clipboard": "Скопировано",
"got_it": "Понятно",
"multi_language": "Мультиязычный",
"multiplayer": "Многопользовательский",
"no_shop_details": "Не удалось получить описание",
"download_options": "Вариантов загрузки",
"download_path": "Путь для загрузок",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@
"dont_show_it_again": "Tekrar gösterme",
"copy_to_clipboard": "Kopyala",
"copied_to_clipboard": "Kopyalandı",
"got_it": "Tamam"
"got_it": "Tamam",
"multi_language": "Çoklu Dil",
"multiplayer": "Çok Oyunculu"
},
"activation": {
"title": "Hydra'yı aktif et",
Expand Down
11 changes: 11 additions & 0 deletions src/main/events/catalogue/repacks/get-magnet-health.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { webTorrentData } from "@main/services/web-torrent-data";
import { registerEvent } from "../../register-event";

const getMagnetHealth = async (
_event: Electron.IpcMainInvokeEvent,
magnet: string
) => {
return webTorrentData.getSeedersAndPeers(magnet);
};

registerEvent("getMagnetHealth", getMagnetHealth);
1 change: 1 addition & 0 deletions src/main/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "./catalogue/get-games";
import "./catalogue/get-how-long-to-beat";
import "./catalogue/get-random-game";
import "./catalogue/search-games";
import "./catalogue/repacks/get-magnet-health";
import "./catalogue/search-game-repacks";
import "./hardware/get-disk-free-space";
import "./library/add-game-to-library";
Expand Down
32 changes: 32 additions & 0 deletions src/main/services/web-torrent-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import WebTorrentHealth from "webtorrent-health";

type WebTorrentHealthData = {
seeds: number;
peers: number;
};

export const webTorrentData = {
async getSeedersAndPeers(magnet: string, retry = 0, timeout = 1500) {
return new Promise((resolve, reject) => {
WebTorrentHealth(
magnet,
{ timeout },
(err: Error, data: WebTorrentHealthData) => {
if (err) {
return reject(err);
}

const { peers, seeds } = data;

if ((!peers || !seeds) && retry < 3) {
return resolve(
webTorrentData.getSeedersAndPeers(magnet, retry + 1, timeout * 2)
);
}

return resolve({ peers, seeders: seeds });
}
);
});
},
ChristoferMendes marked this conversation as resolved.
Show resolved Hide resolved
};
Loading
Loading