mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 16:53:57 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
214e39adda | ||
|
|
8258127616 | ||
|
|
f9906bfe95 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydralauncher",
|
"name": "hydralauncher",
|
||||||
"version": "2.1.1",
|
"version": "2.1.2",
|
||||||
"description": "Hydra",
|
"description": "Hydra",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "Los Broxas",
|
"author": "Los Broxas",
|
||||||
|
|||||||
@@ -3,12 +3,18 @@ import { databasePath } from "./constants";
|
|||||||
import { Hydra2_0_3 } from "./migrations/20240830143811_Hydra_2_0_3";
|
import { Hydra2_0_3 } from "./migrations/20240830143811_Hydra_2_0_3";
|
||||||
import { RepackUris } from "./migrations/20240830143906_RepackUris";
|
import { RepackUris } from "./migrations/20240830143906_RepackUris";
|
||||||
import { UpdateUserLanguage } from "./migrations/20240913213944_update_user_language";
|
import { UpdateUserLanguage } from "./migrations/20240913213944_update_user_language";
|
||||||
|
import { EnsureRepackUris } from "./migrations/20240915035339_ensure_repack_uris";
|
||||||
|
|
||||||
export type HydraMigration = Knex.Migration & { name: string };
|
export type HydraMigration = Knex.Migration & { name: string };
|
||||||
|
|
||||||
class MigrationSource implements Knex.MigrationSource<HydraMigration> {
|
class MigrationSource implements Knex.MigrationSource<HydraMigration> {
|
||||||
getMigrations(): Promise<HydraMigration[]> {
|
getMigrations(): Promise<HydraMigration[]> {
|
||||||
return Promise.resolve([Hydra2_0_3, RepackUris, UpdateUserLanguage]);
|
return Promise.resolve([
|
||||||
|
Hydra2_0_3,
|
||||||
|
RepackUris,
|
||||||
|
UpdateUserLanguage,
|
||||||
|
EnsureRepackUris,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
getMigrationName(migration: HydraMigration): string {
|
getMigrationName(migration: HydraMigration): string {
|
||||||
return migration.name;
|
return migration.name;
|
||||||
|
|||||||
58
src/main/migrations/20240915035339_ensure_repack_uris.ts
Normal file
58
src/main/migrations/20240915035339_ensure_repack_uris.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
import type { HydraMigration } from "@main/knex-client";
|
||||||
|
import type { Knex } from "knex";
|
||||||
|
|
||||||
|
export const EnsureRepackUris: HydraMigration = {
|
||||||
|
name: "EnsureRepackUris",
|
||||||
|
up: async (knex: Knex) => {
|
||||||
|
await knex.schema.createTable("temporary_repack", (table) => {
|
||||||
|
const timestamp = new Date().getTime();
|
||||||
|
table.increments("id").primary();
|
||||||
|
table
|
||||||
|
.text("title")
|
||||||
|
.notNullable()
|
||||||
|
.unique({ indexName: "repack_title_unique_" + timestamp });
|
||||||
|
table
|
||||||
|
.text("magnet")
|
||||||
|
.notNullable()
|
||||||
|
.unique({ indexName: "repack_magnet_unique_" + timestamp });
|
||||||
|
table.text("repacker").notNullable();
|
||||||
|
table.text("fileSize").notNullable();
|
||||||
|
table.datetime("uploadDate").notNullable();
|
||||||
|
table.datetime("createdAt").notNullable().defaultTo(knex.fn.now());
|
||||||
|
table.datetime("updatedAt").notNullable().defaultTo(knex.fn.now());
|
||||||
|
table
|
||||||
|
.integer("downloadSourceId")
|
||||||
|
.references("download_source.id")
|
||||||
|
.onDelete("CASCADE");
|
||||||
|
table.text("uris").notNullable().defaultTo("[]");
|
||||||
|
});
|
||||||
|
await knex.raw(
|
||||||
|
`INSERT INTO "temporary_repack"("id", "title", "magnet", "repacker", "fileSize", "uploadDate", "createdAt", "updatedAt", "downloadSourceId") SELECT "id", "title", "magnet", "repacker", "fileSize", "uploadDate", "createdAt", "updatedAt", "downloadSourceId" FROM "repack"`
|
||||||
|
);
|
||||||
|
await knex.schema.dropTable("repack");
|
||||||
|
await knex.schema.renameTable("temporary_repack", "repack");
|
||||||
|
},
|
||||||
|
|
||||||
|
down: async (knex: Knex) => {
|
||||||
|
await knex.schema.renameTable("repack", "temporary_repack");
|
||||||
|
await knex.schema.createTable("repack", (table) => {
|
||||||
|
table.increments("id").primary();
|
||||||
|
table.text("title").notNullable().unique();
|
||||||
|
table.text("magnet").notNullable().unique();
|
||||||
|
table.integer("page");
|
||||||
|
table.text("repacker").notNullable();
|
||||||
|
table.text("fileSize").notNullable();
|
||||||
|
table.datetime("uploadDate").notNullable();
|
||||||
|
table.datetime("createdAt").notNullable().defaultTo(knex.fn.now());
|
||||||
|
table.datetime("updatedAt").notNullable().defaultTo(knex.fn.now());
|
||||||
|
table
|
||||||
|
.integer("downloadSourceId")
|
||||||
|
.references("download_source.id")
|
||||||
|
.onDelete("CASCADE");
|
||||||
|
});
|
||||||
|
await knex.raw(
|
||||||
|
`INSERT INTO "repack"("id", "title", "magnet", "repacker", "fileSize", "uploadDate", "createdAt", "updatedAt", "downloadSourceId") SELECT "id", "title", "magnet", "repacker", "fileSize", "uploadDate", "createdAt", "updatedAt", "downloadSourceId" FROM "temporary_repack"`
|
||||||
|
);
|
||||||
|
await knex.schema.dropTable("temporary_repack");
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -100,6 +100,7 @@ export function SidebarProfile() {
|
|||||||
textOverflow: "ellipsis",
|
textOverflow: "ellipsis",
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "nowrap",
|
||||||
width: "100%",
|
width: "100%",
|
||||||
|
textAlign: "left",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<small>{gameRunning.title}</small>
|
<small>{gameRunning.title}</small>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const sidebar = recipe({
|
|||||||
paddingTop: `${SPACING_UNIT * 6}px`,
|
paddingTop: `${SPACING_UNIT * 6}px`,
|
||||||
},
|
},
|
||||||
false: {
|
false: {
|
||||||
paddingTop: `${SPACING_UNIT * 2}px`,
|
paddingTop: `${SPACING_UNIT}px`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -160,12 +160,15 @@ export function DownloadSettingsModal({
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{selectedDownloader && selectedDownloader !== Downloader.Torrent && (
|
{selectedDownloader != null &&
|
||||||
<p style={{ marginTop: `${SPACING_UNIT}px` }}>
|
selectedDownloader !== Downloader.Torrent && (
|
||||||
<span style={{ color: vars.color.warning }}>{t("warning")}</span>{" "}
|
<p style={{ marginTop: `${SPACING_UNIT}px` }}>
|
||||||
{t("hydra_needs_to_remain_open")}
|
<span style={{ color: vars.color.warning }}>
|
||||||
</p>
|
{t("warning")}
|
||||||
)}
|
</span>{" "}
|
||||||
|
{t("hydra_needs_to_remain_open")}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user