Skip to content

Commit f5a6a5c

Browse files
Merge pull request #1813 from hydralauncher/feat/remove-dexie
Feat/remove dexie
2 parents a4cc35f + 2cec9f6 commit f5a6a5c

File tree

78 files changed

+3736
-4621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3736
-4621
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hydralauncher",
3-
"version": "3.7.0",
3+
"version": "3.7.1",
44
"description": "Hydra",
55
"main": "./out/main/index.js",
66
"author": "Los Broxas",
@@ -57,7 +57,6 @@
5757
"crc": "^4.3.2",
5858
"create-desktop-shortcuts": "^1.11.1",
5959
"date-fns": "^3.6.0",
60-
"dexie": "^4.0.10",
6160
"electron-log": "^5.4.3",
6261
"electron-updater": "^6.6.2",
6362
"embla-carousel-autoplay": "^8.6.0",

src/locales/en/translation.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@
395395
"stop_seeding": "Stop seeding",
396396
"resume_seeding": "Resume seeding",
397397
"options": "Manage",
398-
"alldebrid_size_not_supported": "Download info for AllDebrid is not supported yet",
399398
"extract": "Extract files",
400399
"extracting": "Extracting files…"
401400
},
@@ -447,6 +446,7 @@
447446
"found_download_option_one": "Found {{countFormatted}} download option",
448447
"found_download_option_other": "Found {{countFormatted}} download options",
449448
"import": "Import",
449+
"importing": "Importing...",
450450
"public": "Public",
451451
"private": "Private",
452452
"friends_only": "Friends only",
@@ -507,17 +507,6 @@
507507
"create_real_debrid_account": "Click here if you don't have a Real-Debrid account yet",
508508
"create_torbox_account": "Click here if you don't have a TorBox account yet",
509509
"real_debrid_account_linked": "Real-Debrid account linked",
510-
"enable_all_debrid": "Enable All-Debrid",
511-
"all_debrid_description": "All-Debrid is an unrestricted downloader that allows you to quickly download files from various sources.",
512-
"all_debrid_free_account_error": "The account \"{{username}}\" is a free account. Please subscribe to All-Debrid",
513-
"all_debrid_account_linked": "All-Debrid account linked successfully",
514-
"alldebrid_missing_key": "Please provide an API key",
515-
"alldebrid_invalid_key": "Invalid API key",
516-
"alldebrid_blocked": "Your API key is geo-blocked or IP-blocked",
517-
"alldebrid_banned": "This account has been banned",
518-
"alldebrid_unknown_error": "An unknown error occurred",
519-
"alldebrid_invalid_response": "Invalid response from All-Debrid",
520-
"alldebrid_network_error": "Network error. Please check your connection",
521510
"name_min_length": "Theme name must be at least 3 characters long",
522511
"import_theme": "Import theme",
523512
"import_theme_description": "You will import {{theme}} from the theme store",
@@ -598,6 +587,7 @@
598587
"activity": "Recent Activity",
599588
"library": "Library",
600589
"pinned": "Pinned",
590+
"sort_by": "Sort by:",
601591
"achievements_earned": "Achievements earned",
602592
"played_recently": "Played recently",
603593
"playtime": "Playtime",

src/locales/es/translation.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@
376376
"found_download_option_one": "Encontrada {{countFormatted}} fuente de descarga",
377377
"found_download_option_other": "Encontradas {{countFormatted}} opciones de descargas",
378378
"import": "Importar",
379+
"importing": "Importando...",
379380
"public": "Público",
380381
"private": "Privado",
381382
"friends_only": "Sólo amigos",

src/locales/hu/translation.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@
394394
"stop_seeding": "Seedelés leállítása",
395395
"resume_seeding": "Seedelés folytatása",
396396
"options": "Kezelés",
397-
"alldebrid_size_not_supported": "Letöltési információ az AllDebrid-hez még nem támogatott",
398397
"extract": "Fájlok kibontása",
399398
"extracting": "Fájlok kibontása…"
400399
},
@@ -506,17 +505,6 @@
506505
"create_real_debrid_account": "Kattints ide ha még nincs Real-Debrid fiókod",
507506
"create_torbox_account": "Kattints ide ha még nincs TorBox fiókod",
508507
"real_debrid_account_linked": "Real-Debrid fiók összekapcsolva",
509-
"enable_all_debrid": "All-Debrid bekapcsolása",
510-
"all_debrid_description": "Az All-Debrid egy korlátozásmentes letöltőprogram, ami lehetővé teszi a fájlok gyors letöltését különböző forrásokból.",
511-
"all_debrid_free_account_error": "Ez a fiók: \"{{username}}\" egy ingyenes fiók. Kérlek iratkozz fel az All-Debridre",
512-
"all_debrid_account_linked": "All-Debrid fiók összekapcsolva",
513-
"alldebrid_missing_key": "Kérlek adj meg egy API key-t",
514-
"alldebrid_invalid_key": "Érvénytelen API key",
515-
"alldebrid_blocked": "Az API key-ed Földrajzilag vagy IP-alapján van blokkolva",
516-
"alldebrid_banned": "Ez a fiók kitiltásra került",
517-
"alldebrid_unknown_error": "Egy ismeretlen hiba történt",
518-
"alldebrid_invalid_response": "Érvénytelen válasz az All-Debrid felől",
519-
"alldebrid_network_error": "Hálózati hiba. Ellenőrízd az internetkapcsolatod",
520508
"name_min_length": "A téma neve legalább 3 karakter hosszú legyen",
521509
"import_theme": "Téma importálása",
522510
"import_theme_description": "Ezt a témát fogod importálni a Témaáruház-ból: {{theme}}",

src/locales/pt-BR/translation.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@
383383
"stop_seeding": "Parar de semear",
384384
"resume_seeding": "Semear",
385385
"options": "Gerenciar",
386-
"alldebrid_size_not_supported": "Informações de download para AllDebrid ainda não são suportadas",
387386
"extract": "Extrair arquivos",
388387
"extracting": "Extraindo arquivos…"
389388
},
@@ -435,6 +434,7 @@
435434
"found_download_option_one": "{{countFormatted}} opção de download encontrada",
436435
"found_download_option_other": "{{countFormatted}} opções de download encontradas",
437436
"import": "Importar",
437+
"importing": "Importando...",
438438
"privacy": "Privacidade",
439439
"private": "Privado",
440440
"friends_only": "Apenas amigos",
@@ -495,17 +495,6 @@
495495
"create_real_debrid_account": "Clique aqui se você ainda não tem uma conta do Real-Debrid",
496496
"create_torbox_account": "Clique aqui se você ainda não tem uma conta do TorBox",
497497
"real_debrid_account_linked": "Conta Real-Debrid associada",
498-
"enable_all_debrid": "Habilitar All-Debrid",
499-
"all_debrid_description": "All-Debrid é um downloader sem restrições que permite baixar rapidamente arquivos de várias fontes.",
500-
"all_debrid_free_account_error": "A conta \"{{username}}\" é uma conta gratuita. Por favor, assine o All-Debrid",
501-
"all_debrid_account_linked": "Conta All-Debrid vinculada com sucesso",
502-
"alldebrid_missing_key": "Por favor, forneça uma chave de API",
503-
"alldebrid_invalid_key": "Chave de API inválida",
504-
"alldebrid_blocked": "Sua chave de API está bloqueada por geolocalização ou IP",
505-
"alldebrid_banned": "Esta conta foi banida",
506-
"alldebrid_unknown_error": "Ocorreu um erro desconhecido",
507-
"alldebrid_invalid_response": "Resposta inválida do All-Debrid",
508-
"alldebrid_network_error": "Erro de rede. Por favor, verifique sua conexão",
509498
"name_min_length": "O nome do tema deve ter pelo menos 3 caracteres",
510499
"import_theme": "Importar tema",
511500
"import_theme_description": "Você irá importar {{theme}} da loja de temas",
@@ -591,10 +580,18 @@
591580
"user_profile": {
592581
"amount_hours": "{{amount}} horas",
593582
"amount_minutes": "{{amount}} minutos",
583+
"amount_hours_short": "{{amount}}h",
584+
"amount_minutes_short": "{{amount}}m",
594585
"last_time_played": "Última sessão {{period}}",
595586
"activity": "Atividades recentes",
596587
"library": "Biblioteca",
588+
"pinned": "Fixados",
589+
"sort_by": "Ordenar por:",
590+
"achievements_earned": "Conquistas obtidas",
591+
"played_recently": "Jogados recentemente",
592+
"playtime": "Tempo de jogo",
597593
"total_play_time": "Tempo total de jogo",
594+
"manual_playtime_tooltip": "Este tempo de jogo foi atualizado manualmente",
598595
"no_recent_activity_title": "Hmmm… nada por aqui",
599596
"no_recent_activity_description": "Parece que você não jogou nada recentemente. Que tal começar agora?",
600597
"display_name": "Nome de exibição",

src/locales/pt-PT/translation.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@
267267
"found_download_option_one": "{{countFormatted}} opção de transferência encontrada",
268268
"found_download_option_other": "{{countFormatted}} opções de transferência encontradas",
269269
"import": "Importar",
270+
"importing": "A importar...",
270271
"privacy": "Privacidade",
271272
"private": "Privado",
272273
"friends_only": "Apenas amigos",
@@ -376,10 +377,18 @@
376377
"user_profile": {
377378
"amount_hours": "{{amount}} horas",
378379
"amount_minutes": "{{amount}} minutos",
380+
"amount_hours_short": "{{amount}}h",
381+
"amount_minutes_short": "{{amount}}m",
379382
"last_time_played": "Última sessão {{period}}",
380383
"activity": "Atividade recente",
381384
"library": "Biblioteca",
385+
"pinned": "Fixados",
386+
"sort_by": "Ordenar por:",
387+
"achievements_earned": "Conquistas obtidas",
388+
"played_recently": "Jogados recentemente",
389+
"playtime": "Tempo de jogo",
382390
"total_play_time": "Tempo total de jogo",
391+
"manual_playtime_tooltip": "Este tempo de jogo foi atualizado manualmente",
383392
"no_recent_activity_title": "Hmmm… não há nada por aqui",
384393
"no_recent_activity_description": "Parece que não jogaste nada recentemente. Que tal começar agora?",
385394
"display_name": "Nome de apresentação",

src/locales/ro/translation.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,7 @@
135135
"real_debrid_free_account_error": "Contul \"{{username}}\" este un cont gratuit. Te rugăm să te abonezi la Real-Debrid",
136136
"debrid_linked_message": "Contul \"{{username}}\" a fost legat",
137137
"save_changes": "Salvează modificările",
138-
"changes_saved": "Modificările au fost salvate cu succes",
139-
"enable_all_debrid": "Activează All-Debrid",
140-
"all_debrid_description": "All-Debrid este un descărcător fără restricții care îți permite să descarci fișiere din diverse surse.",
141-
"all_debrid_free_account_error": "Contul \"{{username}}\" este un cont gratuit. Te rugăm să te abonezi la All-Debrid",
142-
"all_debrid_account_linked": "Contul All-Debrid a fost conectat cu succes"
138+
"changes_saved": "Modificările au fost salvate cu succes"
143139
},
144140
"notifications": {
145141
"download_complete": "Descărcare completă",

src/locales/ru/translation.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@
394394
"stop_seeding": "Остановить раздачу",
395395
"resume_seeding": "Продолжить раздачу",
396396
"options": "Управлять",
397-
"alldebrid_size_not_supported": "Информация о загрузке для AllDebrid пока не поддерживается",
398397
"extract": "Распаковать файлы",
399398
"extracting": "Распаковка файлов…"
400399
},
@@ -446,6 +445,7 @@
446445
"found_download_option_one": "Найден {{countFormatted}} вариант загрузки",
447446
"found_download_option_other": "Найдено {{countFormatted}} вариантов загрузки",
448447
"import": "Импортировать",
448+
"importing": "Импортируется...",
449449
"public": "Публичный",
450450
"private": "Частный",
451451
"friends_only": "Только для друзей",
@@ -506,17 +506,6 @@
506506
"create_real_debrid_account": "Нажмите здесь, если у вас еще нет аккаунта Real-Debrid",
507507
"create_torbox_account": "Нажмите здесь, если у вас еще нет учетной записи TorBox",
508508
"real_debrid_account_linked": "Аккаунт Real-Debrid привязан",
509-
"enable_all_debrid": "Включить All-Debrid",
510-
"all_debrid_description": "All-Debrid - это неограниченный загрузчик, который позволяет быстро скачивать файлы из различных источников.",
511-
"all_debrid_free_account_error": "Аккаунт \"{{username}}\" является бесплатным. Пожалуйста, оформите подписку на All-Debrid",
512-
"all_debrid_account_linked": "Аккаунт All-Debrid успешно привязан",
513-
"alldebrid_missing_key": "Пожалуйста, предоставьте API ключ",
514-
"alldebrid_invalid_key": "Неверный API ключ",
515-
"alldebrid_blocked": "Ваш API ключ заблокирован по геолокации или IP",
516-
"alldebrid_banned": "Этот аккаунт был заблокирован",
517-
"alldebrid_unknown_error": "Произошла неизвестная ошибка",
518-
"alldebrid_invalid_response": "Неверный ответ от All-Debrid",
519-
"alldebrid_network_error": "Ошибка сети. Пожалуйста, проверьте соединение",
520509
"name_min_length": "Название темы должно содержать не менее 3 символов",
521510
"import_theme": "Импортировать тему",
522511
"import_theme_description": "Вы импортируете {{theme}} из магазина тем",

src/locales/uk/translation.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,7 @@
395395
"resume_seeding": "Продовжити сідінг",
396396
"options": "Налаштування",
397397
"extract": "Розархівувати файли",
398-
"extracting": "Розархівовування файлів…",
399-
"alldebrid_size_not_supported": "Інформація про завантаження для AllDebrid поки не підтримується"
398+
"extracting": "Розархівовування файлів…"
400399
},
401400
"settings": {
402401
"downloads_path": "Тека завантажень",
@@ -519,17 +518,6 @@
519518
"installing_common_redist": "Встановлюється…",
520519
"show_download_speed_in_megabytes": "Показувати швидкість завантаження в мегабайтах на секунду",
521520
"extract_files_by_default": "Розпаковувати файли після завантаження",
522-
"enable_all_debrid": "Увімкнути All-Debrid",
523-
"all_debrid_description": "All-Debrid - це необмежений завантажувач, який дозволяє швидко завантажувати файли з різних джерел.",
524-
"all_debrid_free_account_error": "Обліковий запис \"{{username}}\" є безкоштовним. Будь ласка, оформіть підписку на All-Debrid",
525-
"all_debrid_account_linked": "Обліковий запис All-Debrid успішно прив'язано",
526-
"alldebrid_missing_key": "Будь ласка, надайте API-ключ",
527-
"alldebrid_invalid_key": "Невірний API-ключ",
528-
"alldebrid_blocked": "Ваш API-ключ заблоковано за геолокацією або IP",
529-
"alldebrid_banned": "Цей обліковий запис було заблоковано",
530-
"alldebrid_unknown_error": "Сталася невідома помилка",
531-
"alldebrid_invalid_response": "Невірна відповідь від All-Debrid",
532-
"alldebrid_network_error": "Помилка мережі. Будь ласка, перевірте з'єднання",
533521
"enable_steam_achievements": "Увімкнути пошук досягнень Steam",
534522
"achievement_custom_notification_position": "Позиція сповіщень про досягнення",
535523
"top-left": "Верхній лівий кут",
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import { registerEvent } from "../register-event";
2+
import { downloadSourcesSublevel, repacksSublevel } from "@main/level";
3+
import { HydraApi, logger } from "@main/services";
4+
import { importDownloadSourceToLocal } from "./helpers";
5+
6+
const addDownloadSource = async (
7+
_event: Electron.IpcMainInvokeEvent,
8+
url: string
9+
) => {
10+
const result = await importDownloadSourceToLocal(url, true);
11+
if (!result) {
12+
throw new Error("Failed to import download source");
13+
}
14+
15+
// Verify that repacks were actually written to the database (read-after-write)
16+
// This ensures all async operations are complete before proceeding
17+
let repackCount = 0;
18+
for await (const [, repack] of repacksSublevel.iterator()) {
19+
if (repack.downloadSourceId === result.id) {
20+
repackCount++;
21+
}
22+
}
23+
24+
await HydraApi.post("/profile/download-sources", {
25+
urls: [url],
26+
});
27+
28+
const { fingerprint } = await HydraApi.put<{ fingerprint: string }>(
29+
"/download-sources",
30+
{
31+
objectIds: result.objectIds,
32+
},
33+
{ needsAuth: false }
34+
);
35+
36+
// Update the source with fingerprint
37+
const updatedSource = await downloadSourcesSublevel.get(`${result.id}`);
38+
if (updatedSource) {
39+
await downloadSourcesSublevel.put(`${result.id}`, {
40+
...updatedSource,
41+
fingerprint,
42+
updatedAt: new Date(),
43+
});
44+
}
45+
46+
// Final verification: ensure the source with fingerprint is persisted
47+
const finalSource = await downloadSourcesSublevel.get(`${result.id}`);
48+
if (!finalSource || !finalSource.fingerprint) {
49+
throw new Error("Failed to persist download source with fingerprint");
50+
}
51+
52+
// Verify repacks still exist after fingerprint update
53+
let finalRepackCount = 0;
54+
for await (const [, repack] of repacksSublevel.iterator()) {
55+
if (repack.downloadSourceId === result.id) {
56+
finalRepackCount++;
57+
}
58+
}
59+
60+
if (finalRepackCount !== repackCount) {
61+
logger.warn(
62+
`Repack count mismatch! Before: ${repackCount}, After: ${finalRepackCount}`
63+
);
64+
} else {
65+
logger.info(
66+
`Final verification passed: ${finalRepackCount} repacks confirmed`
67+
);
68+
}
69+
70+
return {
71+
...result,
72+
fingerprint,
73+
};
74+
};
75+
76+
registerEvent("addDownloadSource", addDownloadSource);

0 commit comments

Comments
 (0)