mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
feat: adding level generic interface
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import "./get-session-hash";
|
||||
import "./open-auth-window";
|
||||
import "./sign-out";
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
import "./check-for-updates";
|
||||
import "./restart-and-install-update";
|
||||
|
||||
|
||||
@@ -2,4 +2,3 @@ import "./get-game-assets";
|
||||
import "./get-game-shop-details";
|
||||
import "./get-game-stats";
|
||||
import "./get-random-game";
|
||||
|
||||
|
||||
@@ -2,4 +2,3 @@ import "./download-game-artifact";
|
||||
import "./get-game-backup-preview";
|
||||
import "./select-game-backup-path";
|
||||
import "./upload-save-game";
|
||||
|
||||
|
||||
@@ -4,4 +4,3 @@ import "./get-download-sources-since-value";
|
||||
import "./get-download-sources";
|
||||
import "./remove-download-source";
|
||||
import "./sync-download-sources";
|
||||
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
import "./check-folder-write-permission";
|
||||
import "./get-disk-free-space";
|
||||
|
||||
|
||||
@@ -30,4 +30,3 @@ import "./update-executable-path";
|
||||
import "./update-game-custom-assets";
|
||||
import "./update-launch-options";
|
||||
import "./verify-executable-path";
|
||||
|
||||
|
||||
@@ -10,4 +10,3 @@ import "./open-external";
|
||||
import "./save-temp-file";
|
||||
import "./show-item-in-folder";
|
||||
import "./show-open-dialog";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import "./publish-new-repacks-notification";
|
||||
import "./show-achievement-test-notification";
|
||||
import "./update-achievement-notification-window";
|
||||
|
||||
|
||||
@@ -2,4 +2,3 @@ import "./get-me";
|
||||
import "./process-profile-image";
|
||||
import "./sync-friend-requests";
|
||||
import "./update-profile";
|
||||
|
||||
|
||||
@@ -13,4 +13,3 @@ import "./open-editor-window";
|
||||
import "./remove-theme-achievement-sound";
|
||||
import "./toggle-custom-theme";
|
||||
import "./update-custom-theme";
|
||||
|
||||
|
||||
@@ -5,4 +5,3 @@ import "./pause-game-seed";
|
||||
import "./resume-game-download";
|
||||
import "./resume-game-seed";
|
||||
import "./start-game-download";
|
||||
|
||||
|
||||
@@ -3,4 +3,3 @@ import "./authenticate-torbox";
|
||||
import "./auto-launch";
|
||||
import "./get-user-preferences";
|
||||
import "./update-user-preferences";
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import "./get-auth";
|
||||
import "./get-compared-unlocked-achievements";
|
||||
import "./get-unlocked-achievements";
|
||||
|
||||
|
||||
@@ -13,7 +13,9 @@ export class SystemPath {
|
||||
};
|
||||
|
||||
static checkIfPathsAreAvailable() {
|
||||
const paths = Object.keys(SystemPath.paths) as (keyof typeof SystemPath.paths)[];
|
||||
const paths = Object.keys(
|
||||
SystemPath.paths
|
||||
) as (keyof typeof SystemPath.paths)[];
|
||||
|
||||
paths.forEach((pathName) => {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { TorrentDownloader, TorrentSession, TorrentStatus } from "./hydra-native";
|
||||
import {
|
||||
TorrentDownloader,
|
||||
TorrentSession,
|
||||
TorrentStatus,
|
||||
} from "./hydra-native";
|
||||
import { logger } from "./logger";
|
||||
|
||||
// Global torrent session - matches Python's torrent_session
|
||||
@@ -44,7 +48,10 @@ export class TorrentDownloadService {
|
||||
torrentDownloaders.set(downloadId, downloader);
|
||||
return downloader;
|
||||
} catch (error) {
|
||||
logger.error(`Failed to create torrent downloader for ${downloadId}`, error);
|
||||
logger.error(
|
||||
`Failed to create torrent downloader for ${downloadId}`,
|
||||
error
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +102,10 @@ export class TorrentDownloadService {
|
||||
logger.log(`Cancelled torrent download for ${downloadId}`);
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error(`Failed to cancel torrent download for ${downloadId}`, error);
|
||||
logger.error(
|
||||
`Failed to cancel torrent download for ${downloadId}`,
|
||||
error
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -110,9 +120,11 @@ export class TorrentDownloadService {
|
||||
const status = downloader.getDownloadStatus();
|
||||
return status || null;
|
||||
} catch (error) {
|
||||
logger.error(`Failed to get torrent download status for ${downloadId}`, error);
|
||||
logger.error(
|
||||
`Failed to get torrent download status for ${downloadId}`,
|
||||
error
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,10 @@ export function GameOptionsModal({
|
||||
const debounceUpdateLaunchOptions = useRef(
|
||||
debounce(async (value: string) => {
|
||||
const gameKey = getGameKey(game.shop, game.objectId);
|
||||
const gameData = (await levelDBService.get(gameKey, "games")) as Game | null;
|
||||
const gameData = (await levelDBService.get(
|
||||
gameKey,
|
||||
"games"
|
||||
)) as Game | null;
|
||||
if (gameData) {
|
||||
const updated = {
|
||||
...gameData,
|
||||
@@ -221,7 +224,10 @@ export function GameOptionsModal({
|
||||
setLaunchOptions("");
|
||||
|
||||
const gameKey = getGameKey(game.shop, game.objectId);
|
||||
const gameData = (await levelDBService.get(gameKey, "games")) as Game | null;
|
||||
const gameData = (await levelDBService.get(
|
||||
gameKey,
|
||||
"games"
|
||||
)) as Game | null;
|
||||
if (gameData) {
|
||||
const updated = { ...gameData, launchOptions: null };
|
||||
await levelDBService.put(gameKey, updated, "games");
|
||||
@@ -268,7 +274,10 @@ export function GameOptionsModal({
|
||||
setAutomaticCloudSync(event.target.checked);
|
||||
|
||||
const gameKey = getGameKey(game.shop, game.objectId);
|
||||
const gameData = (await levelDBService.get(gameKey, "games")) as Game | null;
|
||||
const gameData = (await levelDBService.get(
|
||||
gameKey,
|
||||
"games"
|
||||
)) as Game | null;
|
||||
if (gameData) {
|
||||
const updated = { ...gameData, automaticCloudSync: event.target.checked };
|
||||
await levelDBService.put(gameKey, updated, "games");
|
||||
|
||||
@@ -146,7 +146,10 @@ export function RepacksModal({
|
||||
.get(gameKey, "games")
|
||||
.then((gameData) => {
|
||||
if (gameData) {
|
||||
const updated = { ...(gameData as Game), newDownloadOptionsCount: undefined };
|
||||
const updated = {
|
||||
...(gameData as Game),
|
||||
newDownloadOptionsCount: undefined,
|
||||
};
|
||||
return levelDBService.put(gameKey, updated, "games");
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user