mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: add option to disable seeding after download completes
This commit is contained in:
parent
5078946191
commit
c314c397a5
3 changed files with 15 additions and 4 deletions
|
@ -2,10 +2,7 @@ import { Game } from "@main/entity";
|
||||||
import { Downloader } from "@shared";
|
import { Downloader } from "@shared";
|
||||||
import { PythonInstance } from "./python-instance";
|
import { PythonInstance } from "./python-instance";
|
||||||
import { WindowManager } from "../window-manager";
|
import { WindowManager } from "../window-manager";
|
||||||
import {
|
import { downloadQueueRepository, gameRepository } from "@main/repository";
|
||||||
downloadQueueRepository,
|
|
||||||
gameRepository,
|
|
||||||
} from "@main/repository";
|
|
||||||
import { publishDownloadCompleteNotification } from "../notifications";
|
import { publishDownloadCompleteNotification } from "../notifications";
|
||||||
import { RealDebridDownloader } from "./real-debrid-downloader";
|
import { RealDebridDownloader } from "./real-debrid-downloader";
|
||||||
import type { DownloadProgress } from "@types";
|
import type { DownloadProgress } from "@types";
|
||||||
|
|
|
@ -121,6 +121,8 @@ export class PythonInstance {
|
||||||
{ id: gameId },
|
{ id: gameId },
|
||||||
{ status: "complete", shouldSeed: false }
|
{ status: "complete", shouldSeed: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.pauseSeeding(gameId);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.downloadingGameId = -1;
|
this.downloadingGameId = -1;
|
||||||
|
|
|
@ -19,6 +19,7 @@ export function SettingsBehavior() {
|
||||||
runAtStartup: false,
|
runAtStartup: false,
|
||||||
startMinimized: false,
|
startMinimized: false,
|
||||||
disableNsfwAlert: false,
|
disableNsfwAlert: false,
|
||||||
|
seedAfterDownloadComplete: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useTranslation("settings");
|
const { t } = useTranslation("settings");
|
||||||
|
@ -30,6 +31,7 @@ export function SettingsBehavior() {
|
||||||
runAtStartup: userPreferences.runAtStartup,
|
runAtStartup: userPreferences.runAtStartup,
|
||||||
startMinimized: userPreferences.startMinimized,
|
startMinimized: userPreferences.startMinimized,
|
||||||
disableNsfwAlert: userPreferences.disableNsfwAlert,
|
disableNsfwAlert: userPreferences.disableNsfwAlert,
|
||||||
|
seedAfterDownloadComplete: userPreferences.seedAfterDownloadComplete,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [userPreferences]);
|
}, [userPreferences]);
|
||||||
|
@ -96,6 +98,16 @@ export function SettingsBehavior() {
|
||||||
handleChange({ disableNsfwAlert: !form.disableNsfwAlert })
|
handleChange({ disableNsfwAlert: !form.disableNsfwAlert })
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<CheckboxField
|
||||||
|
label={t("seed_after_download_complete")}
|
||||||
|
checked={form.seedAfterDownloadComplete}
|
||||||
|
onChange={() =>
|
||||||
|
handleChange({
|
||||||
|
seedAfterDownloadComplete: !form.seedAfterDownloadComplete,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue