mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 08:43:57 +00:00
feat: merge adjustments
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import { DownloadManager, HydraApi, gamesPlaytime } from "@main/services";
|
||||
import { PythonRPC } from "@main/services/python-rpc";
|
||||
import { db, downloadsSublevel, gamesSublevel, levelKeys } from "@main/level";
|
||||
|
||||
const signOut = async (_event: Electron.IpcMainInvokeEvent) => {
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import type { HydraMigration } from "@main/knex-client";
|
||||
import type { Knex } from "knex";
|
||||
|
||||
export const AddTorBoxApiToken: HydraMigration = {
|
||||
name: "AddTorBoxApiToken",
|
||||
up: (knex: Knex) => {
|
||||
return knex.schema.alterTable("user_preferences", (table) => {
|
||||
return table.string("torBoxApiToken").nullable();
|
||||
});
|
||||
},
|
||||
|
||||
down: async (knex: Knex) => {
|
||||
return knex.schema.alterTable("user_preferences", (table) => {
|
||||
return table.dropColumn("torBoxApiToken");
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -271,7 +271,7 @@ export class DownloadManager {
|
||||
};
|
||||
}
|
||||
case Downloader.PixelDrain: {
|
||||
const id = game.uri!.split("/").pop();
|
||||
const id = download.uri.split("/").pop();
|
||||
|
||||
const name = await axios
|
||||
.get(`https://pixeldrain.com/api/file/${id}/info`)
|
||||
@@ -281,7 +281,7 @@ export class DownloadManager {
|
||||
action: "start",
|
||||
game_id: downloadId,
|
||||
url: `https://pixeldrain.com/api/file/${id}?download`,
|
||||
save_path: game.downloadPath!,
|
||||
save_path: download.downloadPath,
|
||||
out: name,
|
||||
};
|
||||
}
|
||||
@@ -326,15 +326,15 @@ export class DownloadManager {
|
||||
};
|
||||
}
|
||||
case Downloader.TorBox: {
|
||||
const { name, url } = await TorBoxClient.getDownloadInfo(game.uri!);
|
||||
const { name, url } = await TorBoxClient.getDownloadInfo(download.uri);
|
||||
console.log(url, name);
|
||||
|
||||
if (!url) return;
|
||||
return {
|
||||
action: "start",
|
||||
game_id: game.id,
|
||||
game_id: downloadId,
|
||||
url,
|
||||
save_path: game.downloadPath!,
|
||||
save_path: download.downloadPath,
|
||||
out: name,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ const onCloseGame = (game: Game) => {
|
||||
if (game.remoteId) {
|
||||
// create backup
|
||||
// todo: check for hydra cloud?
|
||||
createBackup(game.objectID, game.shop, "");
|
||||
createBackup(game.objectId, game.shop, "");
|
||||
|
||||
updateGamePlaytime(
|
||||
game,
|
||||
|
||||
Reference in New Issue
Block a user