Skip to content

Commit

Permalink
Merge pull request #562 from hydralauncher/feature/add-download-sources
Browse files Browse the repository at this point in the history
Feature/add download sources
  • Loading branch information
thegrannychaseroperation authored Jun 8, 2024
2 parents 2af875f + 4b97639 commit d2aef7c
Show file tree
Hide file tree
Showing 121 changed files with 2,864 additions and 2,193 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
name: Build-${{ matrix.os }}
path: |
dist/win-unpacked/**
dist/*-portable.exe
dist/*.zip
dist/*.dmg
dist/*.deb
Expand Down
7 changes: 6 additions & 1 deletion electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ directories:
extraResources:
- aria2
- seeds
- hydra.db
- fastlist.exe
files:
- "!**/.vscode/*"
Expand All @@ -19,13 +18,19 @@ asarUnpack:
win:
executableName: Hydra
requestedExecutionLevel: requireAdministrator
target:
- nsis
- portable
nsis:
artifactName: ${name}-${version}-setup.${ext}
shortcutName: ${productName}
uninstallDisplayName: ${productName}
createDesktopShortcut: always
oneClick: false
allowToChangeInstallationDirectory: true
portable:
artifactName: ${name}-${version}-portable.${ext}
requestExecutionLevel: admin
mac:
entitlementsInherit: build/entitlements.mac.plist
extendInfo:
Expand Down
1 change: 1 addition & 0 deletions electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import react from "@vitejs/plugin-react";
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
import svgr from "vite-plugin-svgr";

export default defineConfig(({ mode }) => {
loadEnv(mode);

Expand Down
Binary file removed hydra.db
Binary file not shown.
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"@reduxjs/toolkit": "^2.2.3",
"@vanilla-extract/css": "^1.14.2",
"@vanilla-extract/recipes": "^0.5.2",
"iso-639-1": "3.1.2",
"aria2": "^4.1.2",
"auto-launch": "^5.0.6",
"axios": "^1.6.8",
Expand All @@ -49,25 +48,30 @@
"classnames": "^2.5.1",
"color": "^4.2.3",
"color.js": "^1.2.0",
"create-desktop-shortcuts": "^1.11.0",
"date-fns": "^3.6.0",
"electron-log": "^5.1.4",
"electron-updater": "^6.1.8",
"fetch-cookie": "^3.0.1",
"flexsearch": "^0.7.43",
"i18next": "^23.11.2",
"i18next-browser-languagedetector": "^7.2.1",
"icojs": "^0.19.3",
"iso-639-1": "3.1.2",
"jsdom": "^24.0.0",
"lodash-es": "^4.17.21",
"lottie-react": "^2.4.0",
"parse-torrent": "^11.0.16",
"piscina": "^4.5.1",
"ps-list": "^8.1.1",
"react-i18next": "^14.1.0",
"react-loading-skeleton": "^3.4.0",
"react-redux": "^9.1.1",
"react-router-dom": "^6.22.3",
"typeorm": "^0.3.20",
"user-agents": "^1.1.193",
"yaml": "^2.4.1"
"yaml": "^2.4.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@commitlint/cli": "^19.3.0",
Expand All @@ -83,9 +87,10 @@
"@types/parse-torrent": "^5.8.7",
"@types/react": "^18.2.48",
"@types/react-dom": "^18.2.18",
"@types/user-agents": "^1.0.4",
"@vanilla-extract/vite-plugin": "^4.0.7",
"@vitejs/plugin-react": "^4.2.1",
"electron": "^28.2.0",
"electron": "^30.0.9",
"electron-builder": "^24.9.1",
"electron-vite": "^2.0.0",
"eslint": "^8.56.0",
Expand Down
2 changes: 1 addition & 1 deletion seeds/steam-games.json

Large diffs are not rendered by default.

60 changes: 51 additions & 9 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"home": {
"featured": "Featured",
"recently_added": "Recently added",
"trending": "Trending",
"surprise_me": "Surprise me",
"no_results": "No results found"
Expand All @@ -15,12 +14,9 @@
"paused": "{{title}} (Paused)",
"downloading": "{{title}} ({{percentage}} - Downloading…)",
"filter": "Filter library",
"follow_us": "Follow us",
"home": "Home",
"discord": "Join our Discord",
"telegram": "Join our Telegram",
"x": "Follow on X",
"github": "Contribute on GitHub"
"queued": "{{title}} (Queued)",
"game_has_no_executable": "Game has no executable selected"
},
"header": {
"search": "Search games",
Expand Down Expand Up @@ -105,7 +101,25 @@
"screenshot": "Screenshot {{number}}",
"open_screenshot": "Open screenshot {{number}}",
"download_settings": "Download settings",
"downloader": "Downloader"
"downloader": "Downloader",
"select_executable": "Select",
"no_executable_selected": "No executable selected",
"open_folder": "Open folder",
"open_download_location": "See downloaded files",
"create_shortcut": "Create desktop shortcut",
"remove_files": "Remove files",
"remove_from_library_title": "Are you sure?",
"remove_from_library_description": "This will remove {{game}} from your library",
"options": "Options",
"executable_section_title": "Executable",
"executable_section_description": "Path of the file that will be executed when \"Play\" is clicked",
"downloads_secion_title": "Downloads",
"downloads_section_description": "Check out updates or other versions of this game",
"danger_zone_section_title": "Danger zone",
"danger_zone_section_description": "Remove this game from your library or the files downloaded by Hydra",
"download_in_progress": "Download in progress",
"download_paused": "Download paused",
"last_downloaded_option": "Last downloaded option"
},
"activation": {
"title": "Activate Hydra",
Expand Down Expand Up @@ -135,7 +149,13 @@
"remove_from_list": "Remove",
"delete_modal_title": "Are you sure?",
"delete_modal_description": "This will remove all the installation files from your computer",
"install": "Install"
"install": "Install",
"download_in_progress": "In progress",
"queued_downloads": "Queued downloads",
"downloads_completed": "Completed",
"queued": "Queued",
"no_downloads_title": "Such empty",
"no_downloads_description": "You haven't downloaded anything with Hydra yet, but it's never too late to start."
},
"settings": {
"downloads_path": "Downloads path",
Expand All @@ -150,6 +170,7 @@
"launch_with_system": "Launch Hydra on system start-up",
"general": "General",
"behavior": "Behavior",
"download_sources": "Download sources",
"language": "Language",
"real_debrid_api_token": "API Token",
"enable_real_debrid": "Enable Real-Debrid",
Expand All @@ -159,7 +180,25 @@
"real_debrid_free_account_error": "The account \"{{username}}\" is a free account. Please subscribe to Real-Debrid",
"real_debrid_linked_message": "Account \"{{username}}\" linked",
"save_changes": "Save changes",
"changes_saved": "Changes successfully saved"
"changes_saved": "Changes successfully saved",
"download_sources_description": "Hydra will fetch the download links from these sources. The source URL must be a direct link to a .json file containing the download links.",
"validate_download_source": "Validate",
"remove_download_source": "Remove",
"add_download_source": "Add source",
"download_count_zero": "No downloads in list",
"download_count_one": "{{countFormatted}} download in list",
"download_count_other": "{{countFormatted}} downloads in list",
"download_options_zero": "No download available",
"download_options_one": "{{countFormatted}} download available",
"download_options_other": "{{countFormatted}} downloads available",
"download_source_url": "Download source URL",
"add_download_source_description": "Insert the URL containing the .json file",
"download_source_up_to_date": "Up-to-date",
"download_source_errored": "Errored",
"sync_download_sources": "Sync sources",
"removed_download_source": "Download source removed",
"added_download_source": "Added download source",
"download_sources_synced": "All download sources are synced"
},
"notifications": {
"download_complete": "Download complete",
Expand All @@ -182,5 +221,8 @@
},
"modal": {
"close": "Close button"
},
"forms": {
"toggle_password_visibility": "Toggle password visibility"
}
}
61 changes: 52 additions & 9 deletions src/locales/pt/translation.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"home": {
"featured": "Destaque",
"recently_added": "Recém adicionados",
"trending": "Populares",
"surprise_me": "Surpreenda-me",
"no_results": "Nenhum resultado encontrado"
Expand All @@ -17,10 +16,8 @@
"filter": "Filtrar biblioteca",
"home": "Início",
"follow_us": "Acompanhe-nos",
"discord": "Entre no nosso Discord",
"telegram": "Entre no nosso Telegram",
"x": "Siga-nos no X",
"github": "Contribua no GitHub"
"queued": "{{title}} (Na fila)",
"game_has_no_executable": "Jogo não possui executável selecionado"
},
"header": {
"search": "Buscar jogos",
Expand Down Expand Up @@ -101,7 +98,25 @@
"screenshot": "Captura de tela {{number}}",
"open_screenshot": "Ver captura de tela {{number}}",
"download_settings": "Ajustes do download",
"downloader": "Downloader"
"downloader": "Downloader",
"select_executable": "Selecionar",
"no_executable_selected": "Nenhum executável selecionado",
"open_folder": "Abrir pasta",
"open_download_location": "Ver arquivos baixados",
"create_shortcut": "Criar atalho na área de trabalho",
"remove_files": "Remover arquivos",
"options": "Opções",
"remove_from_library_description": "Isso irá remover {{game}} da sua biblioteca",
"remove_from_library_title": "Tem certeza?",
"executable_section_title": "Executável",
"executable_section_description": "O caminho do arquivo que será executado ao clicar em \"Jogar\"",
"downloads_secion_title": "Downloads",
"downloads_section_description": "Confira atualizações ou versões diferentes para este mesmo título",
"danger_zone_section_title": "Zona de perigo",
"danger_zone_section_description": "Remova o jogo da sua biblioteca ou os arquivos que foram baixados pelo Hydra",
"download_in_progress": "Download em andamento",
"download_paused": "Download pausado",
"last_downloaded_option": "Última opção baixada"
},
"activation": {
"title": "Ativação",
Expand All @@ -119,7 +134,7 @@
"verifying": "Verificando…",
"completed_at": "Concluído em {{date}}",
"completed": "Concluído",
"removed": "Não baixado",
"removed": "Cancelado",
"download_again": "Baixar novamente",
"cancel": "Cancelar",
"filter": "Filtrar jogos baixados",
Expand All @@ -131,7 +146,13 @@
"delete_modal_description": "Isso removerá todos os arquivos de instalação do seu computador",
"delete_modal_title": "Tem certeza?",
"deleting": "Excluindo instalador…",
"install": "Instalar"
"install": "Instalar",
"download_in_progress": "Baixando agora",
"queued_downloads": "Na fila",
"downloads_completed": "Completo",
"queued": "Na fila",
"no_downloads_title": "Nada por aqui…",
"no_downloads_description": "Você ainda não baixou nada pelo Hydra, mas nunca é tarde para começar."
},
"settings": {
"downloads_path": "Diretório dos downloads",
Expand All @@ -146,6 +167,7 @@
"launch_with_system": "Iniciar o Hydra junto com o sistema",
"general": "Geral",
"behavior": "Comportamento",
"download_sources": "Fontes de download",
"language": "Idioma",
"real_debrid_api_token": "Token de API",
"enable_real_debrid": "Habilitar Real-Debrid",
Expand All @@ -155,7 +177,25 @@
"real_debrid_free_account_error": "A conta \"{{username}}\" é uma conta gratuita. Por favor, assine a Real-Debrid",
"real_debrid_linked_message": "Conta \"{{username}}\" vinculada",
"save_changes": "Salvar mudanças",
"changes_saved": "Ajustes salvos com sucesso"
"changes_saved": "Ajustes salvos com sucesso",
"download_sources_description": "Hydra vai buscar links de download em todas as fonte habilitadas. A URL da fonte deve ser um link direto para um arquivo .json contendo uma lista de links.",
"validate_download_source": "Validar",
"remove_download_source": "Remover",
"add_download_source": "Adicionar fonte",
"download_count_zero": "Sem downloads na lista",
"download_count_one": "{{countFormatted}} download na lista",
"download_count_other": "{{countFormatted}} downloads na lista",
"download_options_zero": "Sem downloads disponíveis",
"download_options_one": "{{countFormatted}} download disponível",
"download_options_other": "{{countFormatted}} downloads disponíveis",
"download_source_url": "URL da fonte",
"add_download_source_description": "Insira a URL contendo o arquivo .json",
"download_source_up_to_date": "Sincronizada",
"download_source_errored": "Falhou",
"sync_download_sources": "Sincronizar",
"removed_download_source": "Fonte removida",
"added_download_source": "Fonte adicionada",
"download_sources_synced": "As fontes foram sincronizadas"
},
"notifications": {
"download_complete": "Download concluído",
Expand All @@ -182,5 +222,8 @@
},
"modal": {
"close": "Botão de fechar"
},
"forms": {
"toggle_password_visibility": "Alternar visibilidade da senha"
}
}
17 changes: 0 additions & 17 deletions src/main/constants.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
import { app } from "electron";
import path from "node:path";

export const repackersOn1337x = [
"DODI",
"FitGirl",
"0xEMPRESS",
"KaOsKrew",
"TinyRepacks",
] as const;

export const repackers = [
...repackersOn1337x,
"Xatab",
"TinyRepacks",
"CPG",
"GOG",
"onlinefix",
] as const;

export const defaultDownloadsPath = app.getPath("downloads");

export const databasePath = path.join(
Expand Down
18 changes: 16 additions & 2 deletions src/main/data-source.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { DataSource } from "typeorm";
import { Game, GameShopCache, Repack, UserPreferences } from "@main/entity";
import {
DownloadQueue,
DownloadSource,
Game,
GameShopCache,
Repack,
UserPreferences,
} from "@main/entity";
import type { BetterSqlite3ConnectionOptions } from "typeorm/driver/better-sqlite3/BetterSqlite3ConnectionOptions";

import { databasePath } from "./constants";
Expand All @@ -10,7 +17,14 @@ export const createDataSource = (
) =>
new DataSource({
type: "better-sqlite3",
entities: [Game, Repack, UserPreferences, GameShopCache],
entities: [
Game,
Repack,
UserPreferences,
GameShopCache,
DownloadSource,
DownloadQueue,
],
synchronize: true,
database: databasePath,
...options,
Expand Down
Loading

0 comments on commit d2aef7c

Please sign in to comment.