Skip to content

Commit

Permalink
Merge pull request #1447 from leandroperin/feat-favorites
Browse files Browse the repository at this point in the history
feat: favorites
  • Loading branch information
thegrannychaseroperation authored Feb 5, 2025
2 parents 70fcc6e + 0481a08 commit 110131f
Show file tree
Hide file tree
Showing 35 changed files with 251 additions and 60 deletions.
4 changes: 3 additions & 1 deletion src/locales/be/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"paused": "{{title}} (Спынена)",
"downloading": "{{title}} ({{percentage}} - Сцягванне…)",
"filter": "Фільтар бібліятэкі",
"home": "Галоўная"
"home": "Галоўная",
"favorites": "Улюбленыя"
},

"header": {
"search": "Пошук",
"home": "Галоўная",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/bg/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"game_has_no_executable": "Играта няма избран изпълним файл",
"sign_in": "Вписване",
"friends": "Приятели",
"need_help": "Имате нужда от помощ??"
"need_help": "Имате нужда от помощ??",
"favorites": "Любими игри"
},
"header": {
"search": "Търсене",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/ca/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
"home": "Inici",
"queued": "{{title}} (En espera)",
"game_has_no_executable": "El joc encara no té un executable seleccionat",
"sign_in": "Entra"
"sign_in": "Entra",
"favorites": "Favorits"
},
"header": {
"search": "Cerca jocs",

"home": "Inici",
"catalogue": "Catàleg",
"downloads": "Baixades",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/cs/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"game_has_no_executable": "Hra nemá zvolen žádný spustitelný soubor",
"sign_in": "Přihlásit se",
"friends": "Přátelé",
"need_help": "Potřebujete pomoc?"
"need_help": "Potřebujete pomoc?",
"favorites": "Oblíbené"
},
"header": {
"search": "Vyhledat hry",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/da/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
"queued": "{{title}} (I køen)",
"game_has_no_executable": "Spillet har ikke nogen eksekverbar fil valgt",
"sign_in": "Log ind",
"friends": "Venner"
"friends": "Venner",
"favorites": "Favoritter"
},
"header": {
"search": "Søg efter spil",

"home": "Hjem",
"catalogue": "Katalog",
"downloads": "Downloads",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
"home": "Home",
"queued": "{{title}} (In Warteschlange)",
"game_has_no_executable": "Spiel hat keine ausführbare Datei gewählt",
"sign_in": "Anmelden"
"sign_in": "Anmelden",
"favorites": "Favoriten"
},
"header": {
"search": "Spiele suchen",

"home": "Home",
"catalogue": "Katalog",
"downloads": "Downloads",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"game_has_no_executable": "Game has no executable selected",
"sign_in": "Sign in",
"friends": "Friends",
"need_help": "Need help?"
"need_help": "Need help?",
"favorites": "Favorites"
},
"header": {
"search": "Search games",
Expand Down Expand Up @@ -190,6 +191,7 @@
"download_error_not_cached_in_real_debrid": "This download is not available on Real-Debrid and polling download status from Real-Debrid is not yet available.",
"download_error_not_cached_in_torbox": "This download is not available on Torbox and polling download status from Torbox is not yet available."
},

"activation": {
"title": "Activate Hydra",
"installation_id": "Installation ID:",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/es/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"game_has_no_executable": "El juego no tiene un ejecutable seleccionado",
"sign_in": "Iniciar sesión",
"friends": "Amigos",
"need_help": "¿Necesitas ayuda?"
"need_help": "¿Necesitas ayuda?",
"favorites": "Favoritos"
},
"header": {
"search": "Buscar juegos",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/et/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"queued": "{{title}} (Järjekorras)",
"game_has_no_executable": "Mängul pole käivitusfaili valitud",
"sign_in": "Logi sisse",
"friends": "Sõbrad"
"friends": "Sõbrad",
"favorites": "Lemmikud"
},
"header": {
"search": "Otsi mänge",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/fa/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"paused": "{{title}} (متوقف شده)",
"downloading": "{{title}} ({{percentage}} - در حال دانلود…)",
"filter": "فیلتر کردن کتابخانه",
"home": "خانه"
"home": "خانه",
"favorites": "علاقه‌مندی‌ها"
},

"header": {
"search": "جستجوی بازی‌ها",
"home": "خانه",
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 @@ -14,10 +14,12 @@
"paused": "{{title}} (En pause)",
"downloading": "{{title}} ({{percentage}} - Téléchargement en cours…)",
"filter": "Filtrer la bibliothèque",
"home": "Page d’accueil"
"home": "Page d’accueil",
"favorites": "Favoris"
},
"header": {
"search": "Recherche",

"catalogue": "Catalogue",
"downloads": "Téléchargements",
"search_results": "Résultats de la recherche",
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 @@ -14,10 +14,12 @@
"paused": "{{title}} (Szünet)",
"downloading": "{{title}} ({{percentage}} - Letöltés…)",
"filter": "Könyvtár szűrése",
"home": "Főoldal"
"home": "Főoldal",
"favorites": "Kedvenc játékok"
},
"header": {
"search": "Keresés",

"home": "Főoldal",
"catalogue": "Katalógus",
"downloads": "Letöltések",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/id/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
"home": "Beranda",
"queued": "{{title}} (Antrian)",
"game_has_no_executable": "Game tidak punya file eksekusi yang dipilih",
"sign_in": "Masuk"
"sign_in": "Masuk",
"favorites": "Favorit"
},
"header": {
"search": "Cari game",

"home": "Beranda",
"catalogue": "Katalog",
"downloads": "Unduhan",
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 @@ -14,10 +14,12 @@
"paused": "{{title}} (In pausa)",
"downloading": "{{title}} ({{percentage}} - Download…)",
"filter": "Filtra libreria",
"home": "Home"
"home": "Home",
"favorites": "Preferiti"
},
"header": {
"search": "Cerca",

"home": "Home",
"catalogue": "Catalogo",
"downloads": "Download",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/kk/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
"home": "Басты бет",
"queued": "{{title}} (Кезекте)",
"game_has_no_executable": "Ойынды іске қосу файлы таңдалмаған",
"sign_in": "Кіру"
"sign_in": "Кіру",
"favorites": "Таңдаулылар"
},

"header": {
"search": "Іздеу",
"home": "Басты бет",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/ko/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"paused": "{{title}} (일시 정지됨)",
"downloading": "{{title}} ({{percentage}} - 다운로드 중…)",
"filter": "라이브러리 정렬",
"home": ""
"home": "",
"favorites": "즐겨찾기"
},

"header": {
"search": "게임 검색하기",
"home": "",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/nb/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@
"queued": "{{title}} (I køen)",
"game_has_no_executable": "Spillet har ikke noen kjørbar fil valgt",
"sign_in": "Logge inn",
"friends": "Venner"
"friends": "Venner",
"favorites": "Favoritter"
},
"header": {
"search": "Søk efter spill",

"home": "Hjem",
"catalogue": "Katalog",
"downloads": "Nedlastinger",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/nl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"paused": "{{title}} (Gepauzeerd)",
"downloading": "{{title}} ({{percentage}} - Downloading…)",
"filter": "Filter Bibliotheek",
"home": "Home"
"home": "Home",
"favorites": "Favorieten"
},
"header": {
"search": "Zoek spellen",

"home": "Home",
"catalogue": "Bibliotheek",
"downloads": "Downloads",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"paused": "{{title}} (Zatrzymano)",
"downloading": "{{title}} ({{percentage}} - Pobieranie…)",
"filter": "Filtruj biblioteke",
"home": "Główna"
"home": "Główna",
"favorites": "Ulubione"
},
"header": {
"search": "Szukaj",

"home": "Główna",
"catalogue": "Katalog",
"downloads": "Pobrane",
Expand Down
5 changes: 4 additions & 1 deletion src/locales/pt-BR/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
"game_has_no_executable": "Jogo não possui executável selecionado",
"sign_in": "Login",
"friends": "Amigos",
"need_help": "Precisa de ajuda?"
"need_help": "Precisa de ajuda?",
"favorites": "Favoritos"
},
"header": {
"search": "Buscar jogos",

"catalogue": "Catálogo",
"downloads": "Downloads",
"search_results": "Resultados da busca",
Expand Down Expand Up @@ -179,6 +181,7 @@
"download_error_not_cached_in_real_debrid": "Este download não está disponível no Real-Debrid e a verificação do status do download não está disponível.",
"download_error_not_cached_in_torbox": "Este download não está disponível no Torbox e a verificação do status do download não está disponível."
},

"activation": {
"title": "Ativação",
"installation_id": "ID da instalação:",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/pt-PT/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
"queued": "{{title}} (Na fila)",
"game_has_no_executable": "O jogo não tem um executável selecionado",
"sign_in": "Iniciar sessão",
"friends": "Amigos"
"friends": "Amigos",
"favorites": "Favoritos"
},
"header": {
"search": "Procurar jogos",

"catalogue": "Catálogo",
"downloads": "Transferências",
"search_results": "Resultados da pesquisa",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/ro/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"paused": "{{title}} (Pauzat)",
"downloading": "{{title}} ({{percentage}} - Se descarcă...)",
"filter": "Filtrează biblioteca",
"home": "Acasă"
"home": "Acasă",
"favorites": "Favorite"
},
"header": {
"search": "Caută jocuri",

"home": "Acasă",
"catalogue": "Catalog",
"downloads": "Descărcări",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"game_has_no_executable": "Файл запуска игры не выбран",
"sign_in": "Войти",
"friends": "Друзья",
"need_help": "Нужна помощь?"
"need_help": "Нужна помощь?",
"favorites": "Избранное"
},
"header": {
"search": "Поиск",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/tr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"game_has_no_executable": "Oyun için bir çalıştırılabilir dosya seçilmedi",
"sign_in": "Giriş yap",
"friends": "Arkadaşlar",
"need_help": "Yardıma mı ihtiyacınız var?"
"need_help": "Yardıma mı ihtiyacınız var?",
"favorites": "Favoriler"
},
"header": {
"search": "Oyunları ara",
Expand Down
4 changes: 3 additions & 1 deletion src/locales/uk/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
"home": "Головна",
"game_has_no_executable": "Не було вибрано файл для запуску гри",
"queued": "{{title}} в черзі",
"sign_in": "Увійти"
"sign_in": "Увійти",
"favorites": "Улюблені"
},
"header": {
"search": "Пошук",

"home": "Головна",
"catalogue": "Каталог",
"downloads": "Завантаження",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"queued": "{{title}} (已加入下载队列)",
"game_has_no_executable": "未选择游戏的可执行文件",
"sign_in": "登入",
"friends": "好友"
"friends": "好友",
"favorites": "收藏"
},
"header": {
"search": "搜索游戏",
Expand Down
2 changes: 2 additions & 0 deletions src/main/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import "./catalogue/get-developers";
import "./hardware/get-disk-free-space";
import "./hardware/check-folder-write-permission";
import "./library/add-game-to-library";
import "./library/add-game-to-favorites";
import "./library/remove-game-from-favorites";
import "./library/create-game-shortcut";
import "./library/close-game";
import "./library/delete-game-folder";
Expand Down
25 changes: 25 additions & 0 deletions src/main/events/library/add-game-to-favorites.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { registerEvent } from "../register-event";
import { gamesSublevel, levelKeys } from "@main/level";
import type { GameShop } from "@types";

const addGameToFavorites = async (
_event: Electron.IpcMainInvokeEvent,
shop: GameShop,
objectId: string
) => {
const gameKey = levelKeys.game(shop, objectId);

const game = await gamesSublevel.get(gameKey);
if (!game) return;

try {
await gamesSublevel.put(gameKey, {
...game,
favorite: true,
});
} catch (error) {
throw new Error(`Failed to update game favorite status: ${error}`);
}
};

registerEvent("addGameToFavorites", addGameToFavorites);
Loading

0 comments on commit 110131f

Please sign in to comment.