mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
temp
This commit is contained in:
parent
c314c397a5
commit
8ec52bf193
2 changed files with 43 additions and 5 deletions
|
@ -76,6 +76,8 @@ export class DownloadManager {
|
||||||
|
|
||||||
const seedStatus = await PythonInstance.getSeedStatus();
|
const seedStatus = await PythonInstance.getSeedStatus();
|
||||||
|
|
||||||
|
console.log(seedStatus);
|
||||||
|
|
||||||
if (seedStatus.length === 0) {
|
if (seedStatus.length === 0) {
|
||||||
for (const game of gamesToSeed) {
|
for (const game of gamesToSeed) {
|
||||||
if (game.uri && game.downloadPath) {
|
if (game.uri && game.downloadPath) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { useAppSelector, useDownload } from "@renderer/hooks";
|
||||||
import * as styles from "./download-group.css";
|
import * as styles from "./download-group.css";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { SPACING_UNIT, vars } from "@renderer/theme.css";
|
import { SPACING_UNIT, vars } from "@renderer/theme.css";
|
||||||
|
import { XCircleIcon } from "@primer/octicons-react";
|
||||||
|
|
||||||
export interface DownloadGroupProps {
|
export interface DownloadGroupProps {
|
||||||
library: LibraryGame[];
|
library: LibraryGame[];
|
||||||
|
@ -44,6 +45,8 @@ export function DownloadGroup({
|
||||||
resumeDownload,
|
resumeDownload,
|
||||||
cancelDownload,
|
cancelDownload,
|
||||||
isGameDeleting,
|
isGameDeleting,
|
||||||
|
pauseSeeding,
|
||||||
|
resumeSeeding,
|
||||||
} = useDownload();
|
} = useDownload();
|
||||||
|
|
||||||
const getFinalDownloadSize = (game: LibraryGame) => {
|
const getFinalDownloadSize = (game: LibraryGame) => {
|
||||||
|
@ -98,7 +101,13 @@ export function DownloadGroup({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.progress === 1) {
|
if (game.progress === 1) {
|
||||||
return <p>{t("completed")}</p>;
|
// return <p>{t("completed")}</p>;
|
||||||
|
|
||||||
|
return game.status === "seeding" ? (
|
||||||
|
<p>{t("seeding")}</p>
|
||||||
|
) : (
|
||||||
|
<p>{t("completed")}</p>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.status === "paused") {
|
if (game.status === "paused") {
|
||||||
|
@ -141,9 +150,15 @@ export function DownloadGroup({
|
||||||
{t("install")}
|
{t("install")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button onClick={() => openDeleteGameModal(game.id)} theme="outline">
|
{game.status === "seeding" ? (
|
||||||
{t("delete")}
|
<Button onClick={() => pauseSeeding(game.id)} theme="outline">
|
||||||
|
{t("stop seeding")}
|
||||||
</Button>
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Button onClick={() => resumeSeeding(game.id)} theme="outline">
|
||||||
|
{t("resume seeding")}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -207,7 +222,11 @@ export function DownloadGroup({
|
||||||
<ul className={styles.downloads}>
|
<ul className={styles.downloads}>
|
||||||
{library.map((game) => {
|
{library.map((game) => {
|
||||||
return (
|
return (
|
||||||
<li key={game.id} className={styles.download}>
|
<li
|
||||||
|
key={game.id}
|
||||||
|
className={styles.download}
|
||||||
|
style={{ position: "relative" }}
|
||||||
|
>
|
||||||
<div className={styles.downloadCover}>
|
<div className={styles.downloadCover}>
|
||||||
<div className={styles.downloadCoverBackdrop}>
|
<div className={styles.downloadCoverBackdrop}>
|
||||||
<img
|
<img
|
||||||
|
@ -246,6 +265,23 @@ export function DownloadGroup({
|
||||||
<div className={styles.downloadActions}>
|
<div className={styles.downloadActions}>
|
||||||
{getGameActions(game)}
|
{getGameActions(game)}
|
||||||
</div>
|
</div>
|
||||||
|
<Button
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
padding: 8,
|
||||||
|
margin: 6,
|
||||||
|
border: "none",
|
||||||
|
minHeight: "unset",
|
||||||
|
borderRadius: "50%",
|
||||||
|
color: vars.color.danger,
|
||||||
|
}}
|
||||||
|
onClick={() => openDeleteGameModal(game.id)}
|
||||||
|
theme="outline"
|
||||||
|
>
|
||||||
|
<XCircleIcon />
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue