mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-19 01:03:57 +00:00
Compare commits
14 Commits
test
...
fix/use-lo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6b38771a8 | ||
|
|
8400edd000 | ||
|
|
6e3c5cac7e | ||
|
|
4f2d6f3302 | ||
|
|
72c3219fc0 | ||
|
|
048c56d670 | ||
|
|
43505a281f | ||
|
|
c380e5f5a0 | ||
|
|
5c32e61569 | ||
|
|
f594cd298a | ||
|
|
bcd6db24c9 | ||
|
|
c2216bbf95 | ||
|
|
f84917a00b | ||
|
|
94ebf94abc |
@@ -153,8 +153,11 @@ def profile_image():
|
|||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
image_path = data.get('image_path')
|
image_path = data.get('image_path')
|
||||||
|
|
||||||
|
# use webp as default value for target_extension
|
||||||
|
target_extension = data.get('target_extension') or 'webp'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
processed_image_path, mime_type = ProfileImageProcessor.process_image(image_path)
|
processed_image_path, mime_type = ProfileImageProcessor.process_image(image_path, target_extension)
|
||||||
return jsonify({'imagePath': processed_image_path, 'mimeType': mime_type}), 200
|
return jsonify({'imagePath': processed_image_path, 'mimeType': mime_type}), 200
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return jsonify({"error": str(e)}), 400
|
return jsonify({"error": str(e)}), 400
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import os, uuid, tempfile
|
|||||||
class ProfileImageProcessor:
|
class ProfileImageProcessor:
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_parsed_image_data(image_path):
|
def get_parsed_image_data(image_path, target_extension):
|
||||||
Image.MAX_IMAGE_PIXELS = 933120000
|
Image.MAX_IMAGE_PIXELS = 933120000
|
||||||
|
|
||||||
image = Image.open(image_path)
|
image = Image.open(image_path)
|
||||||
@@ -16,7 +16,7 @@ class ProfileImageProcessor:
|
|||||||
return image_path, mime_type
|
return image_path, mime_type
|
||||||
else:
|
else:
|
||||||
new_uuid = str(uuid.uuid4())
|
new_uuid = str(uuid.uuid4())
|
||||||
new_image_path = os.path.join(tempfile.gettempdir(), new_uuid) + ".webp"
|
new_image_path = os.path.join(tempfile.gettempdir(), new_uuid) + "." + target_extension
|
||||||
image.save(new_image_path)
|
image.save(new_image_path)
|
||||||
|
|
||||||
new_image = Image.open(new_image_path)
|
new_image = Image.open(new_image_path)
|
||||||
@@ -26,5 +26,5 @@ class ProfileImageProcessor:
|
|||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def process_image(image_path):
|
def process_image(image_path, target_extension):
|
||||||
return ProfileImageProcessor.get_parsed_image_data(image_path)
|
return ProfileImageProcessor.get_parsed_image_data(image_path, target_extension)
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
"no_results": "Nincs találat",
|
"no_results": "Nincs találat",
|
||||||
"start_typing": "Kereséshez gépelj...",
|
"start_typing": "Kereséshez gépelj...",
|
||||||
"hot": "Most felkapott",
|
"hot": "Most felkapott",
|
||||||
"weekly": "📅 A hét felkapottjai",
|
"weekly": "📅 Heti kiemeltek",
|
||||||
"achievements": "🏆 Achievement támogatott"
|
"achievements": "🏆 Achievement támogatott"
|
||||||
},
|
},
|
||||||
"sidebar": {
|
"sidebar": {
|
||||||
"catalogue": "Katalógus",
|
"catalogue": "Katalógus",
|
||||||
|
"library": "Könyvtár",
|
||||||
"downloads": "Letöltések",
|
"downloads": "Letöltések",
|
||||||
"settings": "Beállítások",
|
"settings": "Beállítások",
|
||||||
"my_library": "Könyvtáram",
|
"my_library": "Könyvtáram",
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
"update_decky_plugin": "Decky Plugin Frissítése",
|
"update_decky_plugin": "Decky Plugin Frissítése",
|
||||||
"decky_plugin_installed_version": "Decky Plugin (v{{version}})",
|
"decky_plugin_installed_version": "Decky Plugin (v{{version}})",
|
||||||
"install_decky_plugin_title": "Telepítsd a Hydra Decky Plugint",
|
"install_decky_plugin_title": "Telepítsd a Hydra Decky Plugint",
|
||||||
"install_decky_plugin_message": "Ez letölti és telepíteni fogja a Hydra plugint a Decky Loaderhez. Előfordulhat, hogy rendszergazdai jogosultságra lesz szükség. Folytatod?",
|
"install_decky_plugin_message": "Ez letölti és telepíti a Hydra plugint a Decky Loaderhez. Előfordulhat, hogy rendszergazdai jogosultságra lesz szükség. Folytatod?",
|
||||||
"update_decky_plugin_title": "Hydra Decky Plugin Frissítése",
|
"update_decky_plugin_title": "Hydra Decky Plugin Frissítése",
|
||||||
"update_decky_plugin_message": "Egy új verzió elérhető a Hydra Decky Pluginhoz. Szeretnéd frissíteni?",
|
"update_decky_plugin_message": "Egy új verzió elérhető a Hydra Decky Pluginhoz. Szeretnéd frissíteni?",
|
||||||
"decky_plugin_installed": "Decky plugin v{{version}} sikeresen telepítve",
|
"decky_plugin_installed": "Decky plugin v{{version}} sikeresen telepítve",
|
||||||
@@ -92,8 +93,10 @@
|
|||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"search": "Keresés",
|
"search": "Keresés",
|
||||||
|
"search_library": "Könyvtár böngészése",
|
||||||
"home": "Főoldal",
|
"home": "Főoldal",
|
||||||
"catalogue": "Katalógus",
|
"catalogue": "Katalógus",
|
||||||
|
"library": "Könyvtár",
|
||||||
"downloads": "Letöltések",
|
"downloads": "Letöltések",
|
||||||
"search_results": "Keresési találatok",
|
"search_results": "Keresési találatok",
|
||||||
"settings": "Beállítások",
|
"settings": "Beállítások",
|
||||||
@@ -117,7 +120,7 @@
|
|||||||
"tags": "Címkék",
|
"tags": "Címkék",
|
||||||
"publishers": "Kiadók",
|
"publishers": "Kiadók",
|
||||||
"download_sources": "Letöltési források",
|
"download_sources": "Letöltési források",
|
||||||
"result_count": "{{resultCount}} találatok",
|
"result_count": "{{resultCount}} találat",
|
||||||
"filter_count": "{{filterCount}} elérhető",
|
"filter_count": "{{filterCount}} elérhető",
|
||||||
"clear_filters": "{{filterCount}} kiválaszott szűrő törlése"
|
"clear_filters": "{{filterCount}} kiválaszott szűrő törlése"
|
||||||
},
|
},
|
||||||
@@ -166,11 +169,11 @@
|
|||||||
"download_now": "Letöltés",
|
"download_now": "Letöltés",
|
||||||
"no_shop_details": "A bolt adatai nem érhetőek el.",
|
"no_shop_details": "A bolt adatai nem érhetőek el.",
|
||||||
"download_options": "Letöltési opciók",
|
"download_options": "Letöltési opciók",
|
||||||
"download_path": "Letöltis hely",
|
"download_path": "Letöltési hely",
|
||||||
"previous_screenshot": "Előző screenshot",
|
"previous_screenshot": "Előző screenshot",
|
||||||
"next_screenshot": "Következő screenshot",
|
"next_screenshot": "Következő screenshot",
|
||||||
"screenshot": "Screenshot {{number}}",
|
"screenshot": "Screenshot {{number}}",
|
||||||
"open_screenshot": "Screenshot megnyitása {{number}}",
|
"open_screenshot": "{{number}} Screenshot megnyitása ",
|
||||||
"download_settings": "Letöltési beállítások",
|
"download_settings": "Letöltési beállítások",
|
||||||
"downloader": "Letöltési mód",
|
"downloader": "Letöltési mód",
|
||||||
"select_executable": "Tallózás",
|
"select_executable": "Tallózás",
|
||||||
@@ -194,6 +197,7 @@
|
|||||||
"download_in_progress": "Letöltés folyamatban",
|
"download_in_progress": "Letöltés folyamatban",
|
||||||
"download_paused": "Letöltés szüneteltetve",
|
"download_paused": "Letöltés szüneteltetve",
|
||||||
"last_downloaded_option": "Utoljára letöltött",
|
"last_downloaded_option": "Utoljára letöltött",
|
||||||
|
"new_download_option": "Új",
|
||||||
"create_steam_shortcut": "Steam parancsikon létrehozása",
|
"create_steam_shortcut": "Steam parancsikon létrehozása",
|
||||||
"create_shortcut_success": "A parancsikon létrehozása sikeres",
|
"create_shortcut_success": "A parancsikon létrehozása sikeres",
|
||||||
"you_might_need_to_restart_steam": "Lehetséges hogy újrakell indítsd a Steamet hogy lásd a változást.",
|
"you_might_need_to_restart_steam": "Lehetséges hogy újrakell indítsd a Steamet hogy lásd a változást.",
|
||||||
@@ -223,6 +227,7 @@
|
|||||||
"show_more": "Mutass többet",
|
"show_more": "Mutass többet",
|
||||||
"show_less": "Mutass kevesebbet",
|
"show_less": "Mutass kevesebbet",
|
||||||
"reviews": "Vélemények",
|
"reviews": "Vélemények",
|
||||||
|
"review_played_for": "Játszva",
|
||||||
"leave_a_review": "Hagyd itt a véleményed",
|
"leave_a_review": "Hagyd itt a véleményed",
|
||||||
"write_review_placeholder": "Oszd meg gondolatod a játékról...",
|
"write_review_placeholder": "Oszd meg gondolatod a játékról...",
|
||||||
"sort_newest": "Legújabb",
|
"sort_newest": "Legújabb",
|
||||||
@@ -361,7 +366,10 @@
|
|||||||
"show_original": "Eredeti megjelenítése",
|
"show_original": "Eredeti megjelenítése",
|
||||||
"show_translation": "Fordítás megjelenítése",
|
"show_translation": "Fordítás megjelenítése",
|
||||||
"show_original_translated_from": "Eredeti megjelenítése (fordítva: {{language}})",
|
"show_original_translated_from": "Eredeti megjelenítése (fordítva: {{language}})",
|
||||||
"hide_original": "Eredeti elrejtése"
|
"hide_original": "Eredeti elrejtése",
|
||||||
|
"review_from_blocked_user": "Letiltott felhasználó véleménye",
|
||||||
|
"show": "Megjelenítés",
|
||||||
|
"hide": "Elrejtés"
|
||||||
},
|
},
|
||||||
"activation": {
|
"activation": {
|
||||||
"title": "Hydra Aktiválása",
|
"title": "Hydra Aktiválása",
|
||||||
@@ -488,11 +496,11 @@
|
|||||||
"no_email_account": "Még nincs beállított emailed",
|
"no_email_account": "Még nincs beállított emailed",
|
||||||
"account_data_updated_successfully": "Fiókadatok változtatása sikeres",
|
"account_data_updated_successfully": "Fiókadatok változtatása sikeres",
|
||||||
"renew_subscription": "Hydra Cloud Megújítása",
|
"renew_subscription": "Hydra Cloud Megújítása",
|
||||||
"subscription_expired_at": "Az előfizetésed lejárt, ekkor: {{date}}",
|
"subscription_expired_at": "Az előfizetésed lejárt: {{date}}",
|
||||||
"no_subscription": "Élvezd a Hydrát a lehető legjobb módon",
|
"no_subscription": "Élvezd a Hydrát a lehető legjobb módon",
|
||||||
"become_subscriber": "Légy Hydra Cloud tag",
|
"become_subscriber": "Légy Hydra Cloud tag",
|
||||||
"subscription_renew_cancelled": "Automatikus megújítás kikapcsolva",
|
"subscription_renew_cancelled": "Automatikus megújítás kikapcsolva",
|
||||||
"subscription_renews_on": "Az előfizetésed megújul, ekkor: {{date}}",
|
"subscription_renews_on": "Az előfizetésed megújul: {{date}}",
|
||||||
"bill_sent_until": "A következő számlát ezen napon küldjük",
|
"bill_sent_until": "A következő számlát ezen napon küldjük",
|
||||||
"no_themes": "Úgy látszik nincs egyetlen témád sem még, de ne aggódj, kattints ide hogy elkészítsd a remekművedet.",
|
"no_themes": "Úgy látszik nincs egyetlen témád sem még, de ne aggódj, kattints ide hogy elkészítsd a remekművedet.",
|
||||||
"editor_tab_code": "Code",
|
"editor_tab_code": "Code",
|
||||||
@@ -551,10 +559,19 @@
|
|||||||
"platinum": "Platina",
|
"platinum": "Platina",
|
||||||
"hidden": "Rejtett",
|
"hidden": "Rejtett",
|
||||||
"test_notification": "Értesítés tesztelése",
|
"test_notification": "Értesítés tesztelése",
|
||||||
|
"achievement_sound_volume": "Achievement hangereje",
|
||||||
|
"select_achievement_sound": "Achievement hang kiválasztása",
|
||||||
|
"change_achievement_sound": "Achievement hang megváltoztatása",
|
||||||
|
"remove_achievement_sound": "Achievement hang eltávolítása",
|
||||||
|
"preview_sound": "Hang előnézet",
|
||||||
|
"select": "Kiválaszt",
|
||||||
|
"preview": "Előnézet",
|
||||||
|
"remove": "Eltávolít",
|
||||||
|
"no_sound_file_selected": "Nincs hangfájl kiválasztva",
|
||||||
"notification_preview": "Achievement Értesítés Előnézete",
|
"notification_preview": "Achievement Értesítés Előnézete",
|
||||||
"enable_friend_start_game_notifications": "Amikor egy barátod elkezd játszani egy játékot",
|
"enable_friend_start_game_notifications": "Amikor egy barátod elkezd játszani egy játékot",
|
||||||
"autoplay_trailers_on_game_page": "Játékelőzetes automatikus lejátszása a játék oldalán",
|
"autoplay_trailers_on_game_page": "Játékelőzetes automatikus lejátszása a játék oldalán",
|
||||||
"hide_to_tray_on_game_start": "Hydra elrejtése játék elindításakor a tálcára"
|
"hide_to_tray_on_game_start": "Hydra elrejtése játék indításakor a tálcára"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"download_complete": "Letöltés befejezve",
|
"download_complete": "Letöltés befejezve",
|
||||||
@@ -670,7 +687,7 @@
|
|||||||
"report_reason_other": "Egyéb",
|
"report_reason_other": "Egyéb",
|
||||||
"profile_reported": "Profil bejelentve",
|
"profile_reported": "Profil bejelentve",
|
||||||
"your_friend_code": "A barát kódod:",
|
"your_friend_code": "A barát kódod:",
|
||||||
"upload_banner": "Borítókép feltöltés",
|
"upload_banner": "Borítókép feltöltése",
|
||||||
"uploading_banner": "Borítókép feltöltése…",
|
"uploading_banner": "Borítókép feltöltése…",
|
||||||
"background_image_updated": "Borítókép frissítve",
|
"background_image_updated": "Borítókép frissítve",
|
||||||
"stats": "Statisztikák",
|
"stats": "Statisztikák",
|
||||||
@@ -689,7 +706,31 @@
|
|||||||
"game_added_to_pinned": "Játék hozzáadva a kitűzöttekhez",
|
"game_added_to_pinned": "Játék hozzáadva a kitűzöttekhez",
|
||||||
"karma": "Karma",
|
"karma": "Karma",
|
||||||
"karma_count": "karma",
|
"karma_count": "karma",
|
||||||
"karma_description": "Pozitív értékelésekkel szerzett pontok"
|
"karma_description": "Pozitív értékelésekkel szerzett pontok",
|
||||||
|
"user_reviews": "Vélemények",
|
||||||
|
"delete_review": "Vélemény Törlése",
|
||||||
|
"loading_reviews": "Vélemények betöltése..."
|
||||||
|
},
|
||||||
|
"library": {
|
||||||
|
"library": "Könyvtár",
|
||||||
|
"play": "Játék",
|
||||||
|
"download": "Letöltés",
|
||||||
|
"downloading": "Letöltés..",
|
||||||
|
"game": "játék",
|
||||||
|
"games": "játékok",
|
||||||
|
"grid_view": "Rács nézet",
|
||||||
|
"compact_view": "Kompakt nézet",
|
||||||
|
"large_view": "Nagy nézet",
|
||||||
|
"no_games_title": "A könyvtárad üres",
|
||||||
|
"no_games_description": "Adj játékokat a katalógusból hozzá vagy töltsd le őket hogy bele vágj",
|
||||||
|
"amount_hours": "{{amount}} óra",
|
||||||
|
"amount_minutes": "{{amount}} perc",
|
||||||
|
"amount_hours_short": "{{amount}}ó",
|
||||||
|
"amount_minutes_short": "{{amount}}p",
|
||||||
|
"manual_playtime_tooltip": "Ez a játszottidő manuálisan lett frissítve",
|
||||||
|
"all_games": "Összes Játék",
|
||||||
|
"recently_played": "Nemrég Játszva",
|
||||||
|
"favorites": "Kedvencek"
|
||||||
},
|
},
|
||||||
"achievement": {
|
"achievement": {
|
||||||
"achievement_unlocked": "Achievement feloldva",
|
"achievement_unlocked": "Achievement feloldva",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
"downloads": "İndirilenler",
|
"downloads": "İndirilenler",
|
||||||
"settings": "Ayarlar",
|
"settings": "Ayarlar",
|
||||||
"my_library": "Kütüphanem",
|
"my_library": "Kütüphanem",
|
||||||
|
"library": "Kütüphane",
|
||||||
"downloading_metadata": "{{title}} (Meta verileri indiriliyor…)",
|
"downloading_metadata": "{{title}} (Meta verileri indiriliyor…)",
|
||||||
"paused": "{{title}} (Duraklatıldı)",
|
"paused": "{{title}} (Duraklatıldı)",
|
||||||
"downloading": "{{title}} (%{{percentage}} - İndiriliyor…)",
|
"downloading": "{{title}} (%{{percentage}} - İndiriliyor…)",
|
||||||
@@ -26,7 +27,69 @@
|
|||||||
"sign_in": "Giriş Yap",
|
"sign_in": "Giriş Yap",
|
||||||
"friends": "Arkadaşlar",
|
"friends": "Arkadaşlar",
|
||||||
"need_help": "Yardıma mı ihtiyacınız var?",
|
"need_help": "Yardıma mı ihtiyacınız var?",
|
||||||
"favorites": "Favoriler"
|
"favorites": "Favoriler",
|
||||||
|
"playable_button_title": "Şu anda oynayabileceğin oyunları göster",
|
||||||
|
"add_custom_game_tooltip": "Özel Oyun Ekle",
|
||||||
|
"show_playable_only_tooltip": "Sadece Oynanabilirleri Göster",
|
||||||
|
"custom_game_modal": "Özel Oyun Ekle",
|
||||||
|
"custom_game_modal_description": "Çalıştırılabilir bir dosya seçerek kütüphanene özel oyun ekle",
|
||||||
|
"custom_game_modal_executable_path": "Çalıştırılabilir Dosya Yolu",
|
||||||
|
"custom_game_modal_select_executable": "Çalıştırılabilir dosya seç",
|
||||||
|
"custom_game_modal_title": "Başlık",
|
||||||
|
"custom_game_modal_enter_title": "Başlık gir",
|
||||||
|
"custom_game_modal_browse": "Gözat",
|
||||||
|
"custom_game_modal_cancel": "İptal",
|
||||||
|
"custom_game_modal_add": "Oyun Ekle",
|
||||||
|
"custom_game_modal_adding": "Oyun Ekleniyor...",
|
||||||
|
"custom_game_modal_success": "Özel oyun başarıyla eklendi",
|
||||||
|
"custom_game_modal_failed": "Özel oyun eklenemedi",
|
||||||
|
"custom_game_modal_executable": "Çalıştırılabilir",
|
||||||
|
"edit_game_modal": "Varlıkları Özelleştir",
|
||||||
|
"edit_game_modal_description": "Oyun varlıklarını ve detaylarını özelleştir",
|
||||||
|
"edit_game_modal_title": "Başlık",
|
||||||
|
"edit_game_modal_enter_title": "Başlık gir",
|
||||||
|
"edit_game_modal_image": "Görsel",
|
||||||
|
"edit_game_modal_select_image": "Görsel seç",
|
||||||
|
"edit_game_modal_browse": "Gözat",
|
||||||
|
"edit_game_modal_image_preview": "Görsel önizleme",
|
||||||
|
"edit_game_modal_icon": "İkon",
|
||||||
|
"edit_game_modal_select_icon": "İkon seç",
|
||||||
|
"edit_game_modal_icon_preview": "İkon önizleme",
|
||||||
|
"edit_game_modal_logo": "Logo",
|
||||||
|
"edit_game_modal_select_logo": "Logo seç",
|
||||||
|
"edit_game_modal_logo_preview": "Logo önizleme",
|
||||||
|
"edit_game_modal_hero": "Kütüphane Hero",
|
||||||
|
"edit_game_modal_select_hero": "Kütüphane hero görseli seç",
|
||||||
|
"edit_game_modal_hero_preview": "Kütüphane hero görseli önizleme",
|
||||||
|
"edit_game_modal_cancel": "İptal et",
|
||||||
|
"edit_game_modal_update": "Güncelle",
|
||||||
|
"edit_game_modal_updating": "Güncelleniyor...",
|
||||||
|
"edit_game_modal_fill_required": "Lütfen tüm gerekli alanları doldur",
|
||||||
|
"edit_game_modal_success": "Varlıklar başarıyla güncellendi",
|
||||||
|
"edit_game_modal_failed": "Varlıklar güncellenemedi",
|
||||||
|
"edit_game_modal_image_filter": "Görsel",
|
||||||
|
"edit_game_modal_icon_resolution": "Önerilen çözünürlük: 256x256px",
|
||||||
|
"edit_game_modal_logo_resolution": "Önerilen çözünürlük: 640x360px",
|
||||||
|
"edit_game_modal_hero_resolution": "Önerilen çözünürlük: 1920x620px",
|
||||||
|
"edit_game_modal_assets": "Varlıklar",
|
||||||
|
"edit_game_modal_drop_icon_image_here": "İkon görselini buraya bırak",
|
||||||
|
"edit_game_modal_drop_logo_image_here": "Logo görselini buraya bırak",
|
||||||
|
"edit_game_modal_drop_hero_image_here": "Hero görselini buraya bırak",
|
||||||
|
"edit_game_modal_drop_to_replace_icon": "İkonu değiştirmek için buraya bırak",
|
||||||
|
"edit_game_modal_drop_to_replace_logo": "Logoyu değiştirmek için buraya bırak",
|
||||||
|
"edit_game_modal_drop_to_replace_hero": "Hero'yu değiştirmek için buraya bırak",
|
||||||
|
"install_decky_plugin": "Decky Plugin Kur",
|
||||||
|
"update_decky_plugin": "Decky Plugin Güncelle",
|
||||||
|
"decky_plugin_installed_version": "Decky Plugin (v{{version}})",
|
||||||
|
"install_decky_plugin_title": "Hydra Decky Plugin Kur",
|
||||||
|
"install_decky_plugin_message": "Bu işlem Decky Loader için Hydra plugin'ini indirecek ve kuracak. Bu işlem yükseltilmiş izinler gerektirebilir. Devam et?",
|
||||||
|
"update_decky_plugin_title": "Hydra Decky Plugin Güncelle",
|
||||||
|
"update_decky_plugin_message": "Hydra Decky plugin'inin yeni bir sürümü mevcut. Şimdi güncellemek ister misin?",
|
||||||
|
"decky_plugin_installed": "Decky plugin v{{version}} başarıyla kuruldu",
|
||||||
|
"decky_plugin_installation_failed": "Decky plugin kurulamadı: {{error}}",
|
||||||
|
"decky_plugin_installation_error": "Decky plugin kurulumu hatası: {{error}}",
|
||||||
|
"confirm": "Onayla",
|
||||||
|
"cancel": "İptal"
|
||||||
},
|
},
|
||||||
"header": {
|
"header": {
|
||||||
"search": "Oyunlarda Ara",
|
"search": "Oyunlarda Ara",
|
||||||
@@ -35,6 +98,8 @@
|
|||||||
"downloads": "İndirilenler",
|
"downloads": "İndirilenler",
|
||||||
"search_results": "Arama Sonuçları",
|
"search_results": "Arama Sonuçları",
|
||||||
"settings": "Ayarlar",
|
"settings": "Ayarlar",
|
||||||
|
"search_library": "Kütüphanede ara",
|
||||||
|
"library": "Kütüphane",
|
||||||
"version_available_install": "{{version}} sürümü mevcut. Yeniden başlatıp yüklemek için tıklayın.",
|
"version_available_install": "{{version}} sürümü mevcut. Yeniden başlatıp yüklemek için tıklayın.",
|
||||||
"version_available_download": "{{version}} sürümü mevcut. İndirmek için tıklayın."
|
"version_available_download": "{{version}} sürümü mevcut. İndirmek için tıklayın."
|
||||||
},
|
},
|
||||||
@@ -203,7 +268,108 @@
|
|||||||
"create_start_menu_shortcut": "Başlat Menüsüne kısayol oluştur",
|
"create_start_menu_shortcut": "Başlat Menüsüne kısayol oluştur",
|
||||||
"invalid_wine_prefix_path": "Geçersiz Wine ön ek yolu",
|
"invalid_wine_prefix_path": "Geçersiz Wine ön ek yolu",
|
||||||
"invalid_wine_prefix_path_description": "Wine ön ek yolu hatalı. Lütfen yolu kontrol edin ve tekrar deneyin.",
|
"invalid_wine_prefix_path_description": "Wine ön ek yolu hatalı. Lütfen yolu kontrol edin ve tekrar deneyin.",
|
||||||
"missing_wine_prefix": "Linux'ta yedekleme oluşturmak için Wine ön eki gereklidir"
|
"missing_wine_prefix": "Linux'ta yedekleme oluşturmak için Wine ön eki gereklidir",
|
||||||
|
"already_in_library": "Zaten kütüphanede",
|
||||||
|
"create_shortcut_simple": "Kısayol oluştur",
|
||||||
|
"properties": "Özellikler",
|
||||||
|
"new_download_option": "Yeni",
|
||||||
|
"add_to_favorites": "Favorilere ekle",
|
||||||
|
"remove_from_favorites": "Favorilerden çıkar",
|
||||||
|
"failed_update_favorites": "Favoriler güncellenemedi",
|
||||||
|
"game_removed_from_library": "Oyun kütüphaneden çıkarıldı",
|
||||||
|
"failed_remove_from_library": "Kütüphaneden çıkarılamadı",
|
||||||
|
"files_removed_success": "Dosyalar başarıyla kaldırıldı",
|
||||||
|
"failed_remove_files": "Dosyalar kaldırılamadı",
|
||||||
|
"rating_count": "Puan",
|
||||||
|
"show_more": "Daha fazla göster",
|
||||||
|
"show_less": "Daha az göster",
|
||||||
|
"reviews": "İncelemeler",
|
||||||
|
"review_played_for": "Oynama süresi",
|
||||||
|
"leave_a_review": "İnceleme Yap",
|
||||||
|
"write_review_placeholder": "Bu oyun hakkındaki düşüncelerini paylaş...",
|
||||||
|
"sort_newest": "En yeni",
|
||||||
|
"no_reviews_yet": "Henüz inceleme yok",
|
||||||
|
"be_first_to_review": "Bu oyun hakkındaki düşüncelerini paylaşan ilk kişi ol!",
|
||||||
|
"sort_oldest": "En eski",
|
||||||
|
"sort_highest_score": "En yüksek puan",
|
||||||
|
"sort_lowest_score": "En düşük puan",
|
||||||
|
"sort_most_voted": "En çok oy",
|
||||||
|
"rating": "Puan",
|
||||||
|
"rating_stats": "Puan",
|
||||||
|
"rating_very_negative": "Çok Olumsuz",
|
||||||
|
"rating_negative": "Olumsuz",
|
||||||
|
"rating_neutral": "Nötr",
|
||||||
|
"rating_positive": "Olumlu",
|
||||||
|
"rating_very_positive": "Çok Olumlu",
|
||||||
|
"submit_review": "Gönder",
|
||||||
|
"submitting": "Gönderiliyor...",
|
||||||
|
"review_submitted_successfully": "İnceleme başarıyla gönderildi!",
|
||||||
|
"review_submission_failed": "İnceleme gönderilemedi. Lütfen tekrar dene.",
|
||||||
|
"review_cannot_be_empty": "İnceleme metin alanı boş olamaz.",
|
||||||
|
"review_deleted_successfully": "İnceleme başarıyla silindi.",
|
||||||
|
"review_deletion_failed": "İnceleme silinemedi. Lütfen tekrar dene.",
|
||||||
|
"loading_reviews": "İncelemeler yükleniyor...",
|
||||||
|
"loading_more_reviews": "Daha fazla inceleme yükleniyor...",
|
||||||
|
"load_more_reviews": "Daha fazla inceleme yükle",
|
||||||
|
"you_seemed_to_enjoy_this_game": "Bu oyunu beğenmiş görünüyorsun",
|
||||||
|
"would_you_recommend_this_game": "Bu oyun hakkında bir inceleme yazmak ister misin?",
|
||||||
|
"yes": "Evet",
|
||||||
|
"maybe_later": "Belki sonra",
|
||||||
|
"backup_failed": "Yedekleme başarısız",
|
||||||
|
"update_playtime_title": "Oynama süresini güncelle",
|
||||||
|
"update_playtime_description": "{{game}} için oynama süresini manuel olarak güncelle",
|
||||||
|
"update_playtime": "Oynama süresini güncelle",
|
||||||
|
"update_playtime_success": "Oynama süresi başarıyla güncellendi",
|
||||||
|
"update_playtime_error": "Oynama süresi güncellenemedi",
|
||||||
|
"update_game_playtime": "Oyun oynama süresini güncelle",
|
||||||
|
"manual_playtime_warning": "Saatlerin manuel olarak güncellendiği işaretlenecek ve bu geri alınamaz.",
|
||||||
|
"manual_playtime_tooltip": "Bu oynama süresi manuel olarak güncellendi",
|
||||||
|
"game_removed_from_pinned": "Oyun sabitlenmişlerden çıkarıldı",
|
||||||
|
"game_added_to_pinned": "Oyun sabitlenmişlere eklendi",
|
||||||
|
"artifact_renamed": "Yedekleme başarıyla yeniden adlandırıldı",
|
||||||
|
"rename_artifact": "Yedeklemeyi Yeniden Adlandır",
|
||||||
|
"rename_artifact_description": "Yedeklemeyi daha açıklayıcı bir isimle yeniden adlandır",
|
||||||
|
"artifact_name_label": "Yedekleme adı",
|
||||||
|
"artifact_name_placeholder": "Yedekleme için bir isim gir",
|
||||||
|
"save_changes": "Değişiklikleri kaydet",
|
||||||
|
"required_field": "Bu alan gereklidir",
|
||||||
|
"max_length_field": "Bu alan {{length}} karakterden az olmalıdır",
|
||||||
|
"freeze_backup": "Otomatik yedeklemeler tarafından üzerine yazılmasın diye sabitle",
|
||||||
|
"unfreeze_backup": "Sabitlemeyi kaldır",
|
||||||
|
"backup_frozen": "Yedekleme sabitlendi",
|
||||||
|
"backup_unfrozen": "Yedekleme sabitlemesi kaldırıldı",
|
||||||
|
"backup_freeze_failed": "Yedekleme sabitlenemedi",
|
||||||
|
"backup_freeze_failed_description": "Otomatik yedeklemeler için en az bir boş alan bırakmalısın",
|
||||||
|
"edit_game_modal_button": "Oyun varlıklarını özelleştir",
|
||||||
|
"game_details": "Oyun Detayları",
|
||||||
|
"currency_symbol": "₺",
|
||||||
|
"currency_country": "tr",
|
||||||
|
"prices": "Fiyatlar",
|
||||||
|
"no_prices_found": "Fiyat bulunamadı",
|
||||||
|
"view_all_prices": "Tüm fiyatları görüntülemek için tıkla",
|
||||||
|
"retail_price": "Perakende fiyatı",
|
||||||
|
"keyshop_price": "Anahtar dükkanı fiyatı",
|
||||||
|
"historical_retail": "Geçmiş perakende",
|
||||||
|
"historical_keyshop": "Geçmiş anahtar dükkanı",
|
||||||
|
"language": "Dil",
|
||||||
|
"caption": "Altyazı",
|
||||||
|
"audio": "Ses",
|
||||||
|
"filter_by_source": "Kaynağa göre filtrele",
|
||||||
|
"no_repacks_found": "Bu oyun için kaynak bulunamadı",
|
||||||
|
"delete_review": "İncelemeyi sil",
|
||||||
|
"remove_review": "İncelemeyi Kaldır",
|
||||||
|
"delete_review_modal_title": "İncelemeni silmek istediğinden emin misin?",
|
||||||
|
"delete_review_modal_description": "Bu işlem geri alınamaz.",
|
||||||
|
"delete_review_modal_delete_button": "Sil",
|
||||||
|
"delete_review_modal_cancel_button": "İptal",
|
||||||
|
"vote_failed": "Oyun kaydı başarısız oldu. Lütfen tekrar dene.",
|
||||||
|
"show_original": "Orijinali göster",
|
||||||
|
"show_translation": "Çeviriyi göster",
|
||||||
|
"show_original_translated_from": "Orijinali göster ({{language}} dilinden çevrilmiştir)",
|
||||||
|
"hide_original": "Orijinali gizle",
|
||||||
|
"review_from_blocked_user": "Engellenen kullanıcıdan gelen inceleme",
|
||||||
|
"show": "Göster",
|
||||||
|
"hide": "Gizle"
|
||||||
},
|
},
|
||||||
"activation": {
|
"activation": {
|
||||||
"title": "Hydra'yı Etkinleştir",
|
"title": "Hydra'yı Etkinleştir",
|
||||||
@@ -379,7 +545,33 @@
|
|||||||
"hidden": "Gizli",
|
"hidden": "Gizli",
|
||||||
"test_notification": "Test bildirimi",
|
"test_notification": "Test bildirimi",
|
||||||
"notification_preview": "Başarı Bildirimi Önizlemesi",
|
"notification_preview": "Başarı Bildirimi Önizlemesi",
|
||||||
"enable_friend_start_game_notifications": "Bir arkadaşınız oyun oynamaya başladığında"
|
"enable_friend_start_game_notifications": "Bir arkadaşınız oyun oynamaya başladığında",
|
||||||
|
"adding": "Ekleniyor…",
|
||||||
|
"failed_add_download_source": "İndirme kaynağı eklenemedi. Lütfen tekrar dene.",
|
||||||
|
"download_source_already_exists": "Bu indirme kaynağı URL'si zaten mevcut.",
|
||||||
|
"download_source_pending_matching": "Yakında güncellenecek",
|
||||||
|
"download_source_matched": "Güncel",
|
||||||
|
"download_source_matching": "Güncelleniyor",
|
||||||
|
"download_source_failed": "Hata",
|
||||||
|
"download_source_no_information": "Bilgi mevcut değil",
|
||||||
|
"removed_all_download_sources": "Tüm indirme kaynakları kaldırıldı",
|
||||||
|
"download_sources_synced_successfully": "Tüm indirme kaynakları senkronize edildi",
|
||||||
|
"importing": "İçe aktarılıyor...",
|
||||||
|
"hydra_cloud": "Hydra Cloud",
|
||||||
|
"debrid": "Debrid",
|
||||||
|
"debrid_description": "Debrid servisleri, internet hızınızla sınırlı, çeşitli dosya barındırma hizmetlerinde barındırılan dosyaları hızla indirmenize olanak tanıyan premium sınırsız indiricilerdir.",
|
||||||
|
"enable_steam_achievements": "Steam başarımları aramasını etkinleştir",
|
||||||
|
"achievement_sound_volume": "Başarım ses seviyesi",
|
||||||
|
"select_achievement_sound": "Başarım sesi seç",
|
||||||
|
"change_achievement_sound": "Başarım sesini değiştir",
|
||||||
|
"remove_achievement_sound": "Başarım sesini kaldır",
|
||||||
|
"preview_sound": "Sesi önizle",
|
||||||
|
"select": "Seç",
|
||||||
|
"preview": "Önizle",
|
||||||
|
"remove": "Kaldır",
|
||||||
|
"no_sound_file_selected": "Ses dosyası seçilmedi",
|
||||||
|
"autoplay_trailers_on_game_page": "Oyun sayfasında fragmanları otomatik olarak oynat",
|
||||||
|
"hide_to_tray_on_game_start": "Oyun başlatıldığında Hydra'yı sistem tepsisine gizle"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"download_complete": "İndirme tamamlandı",
|
"download_complete": "İndirme tamamlandı",
|
||||||
@@ -406,7 +598,8 @@
|
|||||||
"game_card": {
|
"game_card": {
|
||||||
"available_one": "Mevcut",
|
"available_one": "Mevcut",
|
||||||
"available_other": "Mevcut",
|
"available_other": "Mevcut",
|
||||||
"no_downloads": "İndirme mevcut değil"
|
"no_downloads": "İndirme mevcut değil",
|
||||||
|
"calculating": "Hesaplanıyor"
|
||||||
},
|
},
|
||||||
"binary_not_found_modal": {
|
"binary_not_found_modal": {
|
||||||
"title": "Programlar Yüklü Değil",
|
"title": "Programlar Yüklü Değil",
|
||||||
@@ -498,7 +691,46 @@
|
|||||||
"achievements_unlocked": "Açılan başarımlar",
|
"achievements_unlocked": "Açılan başarımlar",
|
||||||
"earned_points": "Kazanılan puanlar",
|
"earned_points": "Kazanılan puanlar",
|
||||||
"show_achievements_on_profile": "Başarımlarını profilinde göster",
|
"show_achievements_on_profile": "Başarımlarını profilinde göster",
|
||||||
"show_points_on_profile": "Kazanılan puanlarını profilinde göster"
|
"show_points_on_profile": "Kazanılan puanlarını profilinde göster",
|
||||||
|
"amount_hours_short": "{{amount}}s",
|
||||||
|
"amount_minutes_short": "{{amount}}d",
|
||||||
|
"pinned": "Sabitlenmiş",
|
||||||
|
"sort_by": "Sırala:",
|
||||||
|
"achievements_earned": "Kazanılan başarımlar",
|
||||||
|
"played_recently": "Son oynanan",
|
||||||
|
"playtime": "Oynama süresi",
|
||||||
|
"manual_playtime_tooltip": "Bu oynama süresi manuel olarak güncellendi",
|
||||||
|
"error_adding_friend": "Arkadaş isteği gönderilemedi. Lütfen arkadaş kodunu kontrol et",
|
||||||
|
"friend_code_length_error": "Arkadaş kodu 8 karakter olmalıdır",
|
||||||
|
"game_removed_from_pinned": "Oyun sabitlenmişlerden çıkarıldı",
|
||||||
|
"game_added_to_pinned": "Oyun sabitlenmişlere eklendi",
|
||||||
|
"karma": "Karma",
|
||||||
|
"karma_count": "karma",
|
||||||
|
"karma_description": "İncelemelerdeki olumlu beğenilerden kazanılır",
|
||||||
|
"user_reviews": "İncelemeler",
|
||||||
|
"delete_review": "İncelemeyi Sil",
|
||||||
|
"loading_reviews": "İncelemeler yükleniyor..."
|
||||||
|
},
|
||||||
|
"library": {
|
||||||
|
"library": "Kütüphane",
|
||||||
|
"play": "Oyna",
|
||||||
|
"download": "İndir",
|
||||||
|
"downloading": "İndiriliyor",
|
||||||
|
"game": "oyun",
|
||||||
|
"games": "oyunlar",
|
||||||
|
"grid_view": "Izgara görünümü",
|
||||||
|
"compact_view": "Kompakt görünüm",
|
||||||
|
"large_view": "Büyük görünüm",
|
||||||
|
"no_games_title": "Kütüphanen boş",
|
||||||
|
"no_games_description": "Başlamak için katalogdan oyun ekle veya indir",
|
||||||
|
"amount_hours": "{{amount}} saat",
|
||||||
|
"amount_minutes": "{{amount}} dakika",
|
||||||
|
"amount_hours_short": "{{amount}}s",
|
||||||
|
"amount_minutes_short": "{{amount}}d",
|
||||||
|
"manual_playtime_tooltip": "Bu oynama süresi manuel olarak güncellendi",
|
||||||
|
"all_games": "Tüm Oyunlar",
|
||||||
|
"recently_played": "Son Oynanan",
|
||||||
|
"favorites": "Favoriler"
|
||||||
},
|
},
|
||||||
"achievement": {
|
"achievement": {
|
||||||
"achievement_unlocked": "Başarım açıldı",
|
"achievement_unlocked": "Başarım açıldı",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import type { LibraryGame } from "@types";
|
|||||||
import { registerEvent } from "../register-event";
|
import { registerEvent } from "../register-event";
|
||||||
import {
|
import {
|
||||||
downloadsSublevel,
|
downloadsSublevel,
|
||||||
|
gameAchievementsSublevel,
|
||||||
gamesShopAssetsSublevel,
|
gamesShopAssetsSublevel,
|
||||||
gamesSublevel,
|
gamesSublevel,
|
||||||
} from "@main/level";
|
} from "@main/level";
|
||||||
@@ -18,11 +19,20 @@ const getLibrary = async (): Promise<LibraryGame[]> => {
|
|||||||
const download = await downloadsSublevel.get(key);
|
const download = await downloadsSublevel.get(key);
|
||||||
const gameAssets = await gamesShopAssetsSublevel.get(key);
|
const gameAssets = await gamesShopAssetsSublevel.get(key);
|
||||||
|
|
||||||
|
let unlockedAchievementCount = game.unlockedAchievementCount ?? 0;
|
||||||
|
|
||||||
|
if (!game.unlockedAchievementCount) {
|
||||||
|
const achievements = await gameAchievementsSublevel.get(key);
|
||||||
|
|
||||||
|
unlockedAchievementCount =
|
||||||
|
achievements?.unlockedAchievements.length ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: key,
|
id: key,
|
||||||
...game,
|
...game,
|
||||||
download: download ?? null,
|
download: download ?? null,
|
||||||
unlockedAchievementCount: game.unlockedAchievementCount ?? 0,
|
unlockedAchievementCount,
|
||||||
achievementCount: game.achievementCount ?? 0,
|
achievementCount: game.achievementCount ?? 0,
|
||||||
// Spread gameAssets last to ensure all image URLs are properly set
|
// Spread gameAssets last to ensure all image URLs are properly set
|
||||||
...gameAssets,
|
...gameAssets,
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
import { registerEvent } from "../register-event";
|
import { registerEvent } from "../register-event";
|
||||||
import { PythonRPC } from "@main/services/python-rpc";
|
import { PythonRPC } from "@main/services/python-rpc";
|
||||||
|
|
||||||
const processProfileImage = async (
|
const processProfileImageEvent = async (
|
||||||
_event: Electron.IpcMainInvokeEvent,
|
_event: Electron.IpcMainInvokeEvent,
|
||||||
path: string
|
path: string
|
||||||
) => {
|
) => {
|
||||||
|
return processProfileImage(path, "webp");
|
||||||
|
};
|
||||||
|
|
||||||
|
export const processProfileImage = async (path: string, extension?: string) => {
|
||||||
return PythonRPC.rpc
|
return PythonRPC.rpc
|
||||||
.post<{
|
.post<{
|
||||||
imagePath: string;
|
imagePath: string;
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
}>("/profile-image", { image_path: path })
|
}>("/profile-image", { image_path: path, target_extension: extension })
|
||||||
.then((response) => response.data);
|
.then((response) => response.data);
|
||||||
};
|
};
|
||||||
|
|
||||||
registerEvent("processProfileImage", processProfileImage);
|
registerEvent("processProfileImage", processProfileImageEvent);
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ import { db, levelKeys, themesSublevel } from "@main/level";
|
|||||||
import { restartAndInstallUpdate } from "@main/events/autoupdater/restart-and-install-update";
|
import { restartAndInstallUpdate } from "@main/events/autoupdater/restart-and-install-update";
|
||||||
import { SystemPath } from "../system-path";
|
import { SystemPath } from "../system-path";
|
||||||
import { getThemeSoundPath } from "@main/helpers";
|
import { getThemeSoundPath } from "@main/helpers";
|
||||||
|
import { processProfileImage } from "@main/events/profile/process-profile-image";
|
||||||
|
|
||||||
|
const getStaticImage = async (path: string) => {
|
||||||
|
return processProfileImage(path, "jpg")
|
||||||
|
.then((response) => response.imagePath)
|
||||||
|
.catch(() => path);
|
||||||
|
};
|
||||||
|
|
||||||
async function downloadImage(url: string | null) {
|
async function downloadImage(url: string | null) {
|
||||||
if (!url) return undefined;
|
if (!url) return undefined;
|
||||||
@@ -31,8 +38,9 @@ async function downloadImage(url: string | null) {
|
|||||||
response.data.pipe(writer);
|
response.data.pipe(writer);
|
||||||
|
|
||||||
return new Promise<string | undefined>((resolve) => {
|
return new Promise<string | undefined>((resolve) => {
|
||||||
writer.on("finish", () => {
|
writer.on("finish", async () => {
|
||||||
resolve(outputPath);
|
const staticImagePath = await getStaticImage(outputPath);
|
||||||
|
resolve(staticImagePath);
|
||||||
});
|
});
|
||||||
writer.on("error", () => {
|
writer.on("error", () => {
|
||||||
logger.error("Failed to download image", { url });
|
logger.error("Failed to download image", { url });
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ export const friendRequestEvent = async (payload: FriendRequest) => {
|
|||||||
friendRequestCount: payload.friendRequestCount,
|
friendRequestCount: payload.friendRequestCount,
|
||||||
});
|
});
|
||||||
|
|
||||||
const user = await HydraApi.get(`/users/${payload.senderId}`);
|
if (payload.senderId) {
|
||||||
|
const user = await HydraApi.get(`/users/${payload.senderId}`);
|
||||||
|
|
||||||
if (user) {
|
if (user) {
|
||||||
publishNewFriendRequestNotification(user);
|
publishNewFriendRequestNotification(user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,25 +7,9 @@ export function useLibrary() {
|
|||||||
const library = useAppSelector((state) => state.library.value);
|
const library = useAppSelector((state) => state.library.value);
|
||||||
|
|
||||||
const updateLibrary = useCallback(async () => {
|
const updateLibrary = useCallback(async () => {
|
||||||
return window.electron.getLibrary().then(async (updatedLibrary) => {
|
return window.electron
|
||||||
const libraryWithAchievements = await Promise.all(
|
.getLibrary()
|
||||||
updatedLibrary.map(async (game) => {
|
.then((updatedLibrary) => dispatch(setLibrary(updatedLibrary)));
|
||||||
const unlockedAchievements =
|
|
||||||
await window.electron.getUnlockedAchievements(
|
|
||||||
game.objectId,
|
|
||||||
game.shop
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
...game,
|
|
||||||
unlockedAchievementCount:
|
|
||||||
game.unlockedAchievementCount || unlockedAchievements.length,
|
|
||||||
};
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
dispatch(setLibrary(libraryWithAchievements));
|
|
||||||
});
|
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
return { library, updateLibrary };
|
return { library, updateLibrary };
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { LibraryGame } from "@types";
|
import { LibraryGame } from "@types";
|
||||||
import { useGameCard } from "@renderer/hooks";
|
import { useGameCard } from "@renderer/hooks";
|
||||||
import { ClockIcon, AlertFillIcon, TrophyIcon } from "@primer/octicons-react";
|
import { ClockIcon, AlertFillIcon, TrophyIcon } from "@primer/octicons-react";
|
||||||
import { memo, useMemo } from "react";
|
import { memo, useEffect, useMemo, useState } from "react";
|
||||||
import "./library-game-card-large.scss";
|
import "./library-game-card-large.scss";
|
||||||
|
|
||||||
interface LibraryGameCardLargeProps {
|
interface LibraryGameCardLargeProps {
|
||||||
@@ -48,6 +48,20 @@ export const LibraryGameCardLarge = memo(function LibraryGameCardLarge({
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const [unlockedAchievementsCount, setUnlockedAchievementsCount] = useState(
|
||||||
|
game.unlockedAchievementCount ?? 0
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (game.unlockedAchievementCount) return;
|
||||||
|
|
||||||
|
window.electron
|
||||||
|
.getUnlockedAchievements(game.objectId, game.shop)
|
||||||
|
.then((achievements) => {
|
||||||
|
setUnlockedAchievementsCount(achievements.length);
|
||||||
|
});
|
||||||
|
}, [game]);
|
||||||
|
|
||||||
const backgroundStyle = useMemo(
|
const backgroundStyle = useMemo(
|
||||||
() =>
|
() =>
|
||||||
backgroundImage ? { backgroundImage: `url(${backgroundImage})` } : {},
|
backgroundImage ? { backgroundImage: `url(${backgroundImage})` } : {},
|
||||||
@@ -56,9 +70,9 @@ export const LibraryGameCardLarge = memo(function LibraryGameCardLarge({
|
|||||||
|
|
||||||
const achievementBarStyle = useMemo(
|
const achievementBarStyle = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
width: `${((game.unlockedAchievementCount ?? 0) / (game.achievementCount ?? 1)) * 100}%`,
|
width: `${(unlockedAchievementsCount / (game.achievementCount ?? 1)) * 100}%`,
|
||||||
}),
|
}),
|
||||||
[game.unlockedAchievementCount, game.achievementCount]
|
[unlockedAchievementsCount, game.achievementCount]
|
||||||
);
|
);
|
||||||
|
|
||||||
const logoImage = game.customLogoImageUrl ?? game.logoImageUrl;
|
const logoImage = game.customLogoImageUrl ?? game.logoImageUrl;
|
||||||
@@ -116,14 +130,12 @@ export const LibraryGameCardLarge = memo(function LibraryGameCardLarge({
|
|||||||
className="library-game-card-large__achievement-trophy"
|
className="library-game-card-large__achievement-trophy"
|
||||||
/>
|
/>
|
||||||
<span className="library-game-card-large__achievement-count">
|
<span className="library-game-card-large__achievement-count">
|
||||||
{game.unlockedAchievementCount ?? 0} /{" "}
|
{unlockedAchievementsCount} / {game.achievementCount ?? 0}
|
||||||
{game.achievementCount ?? 0}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<span className="library-game-card-large__achievement-percentage">
|
<span className="library-game-card-large__achievement-percentage">
|
||||||
{Math.round(
|
{Math.round(
|
||||||
((game.unlockedAchievementCount ?? 0) /
|
(unlockedAchievementsCount / (game.achievementCount ?? 1)) *
|
||||||
(game.achievementCount ?? 1)) *
|
|
||||||
100
|
100
|
||||||
)}
|
)}
|
||||||
%
|
%
|
||||||
|
|||||||
@@ -14,10 +14,6 @@ import "./library.scss";
|
|||||||
|
|
||||||
export default function Library() {
|
export default function Library() {
|
||||||
const { library, updateLibrary } = useLibrary();
|
const { library, updateLibrary } = useLibrary();
|
||||||
type ElectronAPI = {
|
|
||||||
refreshLibraryAssets?: () => Promise<unknown>;
|
|
||||||
onLibraryBatchComplete?: (cb: () => void) => () => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
const [viewMode, setViewMode] = useState<ViewMode>(() => {
|
const [viewMode, setViewMode] = useState<ViewMode>(() => {
|
||||||
const savedViewMode = localStorage.getItem("library-view-mode");
|
const savedViewMode = localStorage.getItem("library-view-mode");
|
||||||
@@ -41,22 +37,15 @@ export default function Library() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
dispatch(setHeaderTitle(t("library")));
|
dispatch(setHeaderTitle(t("library")));
|
||||||
const electron = (globalThis as unknown as { electron?: ElectronAPI })
|
|
||||||
.electron;
|
const unsubscribe = window.electron.onLibraryBatchComplete(() => {
|
||||||
let unsubscribe: () => void = () => undefined;
|
|
||||||
if (electron?.refreshLibraryAssets) {
|
|
||||||
electron
|
|
||||||
.refreshLibraryAssets()
|
|
||||||
.then(() => updateLibrary())
|
|
||||||
.catch(() => updateLibrary());
|
|
||||||
if (electron.onLibraryBatchComplete) {
|
|
||||||
unsubscribe = electron.onLibraryBatchComplete(() => {
|
|
||||||
updateLibrary();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
updateLibrary();
|
updateLibrary();
|
||||||
}
|
});
|
||||||
|
|
||||||
|
window.electron
|
||||||
|
.refreshLibraryAssets()
|
||||||
|
.then(() => updateLibrary())
|
||||||
|
.catch(() => updateLibrary());
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
|
|||||||
Reference in New Issue
Block a user