feat: adding torbox integration

This commit is contained in:
Chubby Granny Chaser
2024-12-25 21:39:59 +00:00
parent 83e662f633
commit 201d89e2c4
9 changed files with 58 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -8,6 +8,7 @@ export const DOWNLOADER_NAME = {
[Downloader.Gofile]: "Gofile",
[Downloader.PixelDrain]: "PixelDrain",
[Downloader.Qiwi]: "Qiwi",
[Downloader.TorBox]: "TorBox",
};
export const MAX_MINUTES_TO_SHOW_IN_PLAYTIME = 120;

View File

@@ -31,6 +31,8 @@ import {
XCircleIcon,
} from "@primer/octicons-react";
import torBoxLogo from "@renderer/assets/icons/torbox.webp";
export interface DownloadGroupProps {
library: LibraryGame[];
title: string;
@@ -276,7 +278,28 @@ export function DownloadGroup({
/>
<div className={styles.downloadCoverContent}>
<Badge>{DOWNLOADER_NAME[game.downloader]}</Badge>
{game.downloader === Downloader.TorBox ? (
<div
style={{
display: "flex",
alignItems: "center",
background: "#11141b",
padding: `${SPACING_UNIT / 2}px ${SPACING_UNIT}px`,
borderRadius: "4px",
gap: 4,
border: `1px solid ${vars.color.border}`,
}}
>
<img
src={torBoxLogo}
alt="TorBox"
style={{ width: 13 }}
/>
<span style={{ fontSize: 10 }}>TorBox</span>
</div>
) : (
<Badge>{DOWNLOADER_NAME[game.downloader]}</Badge>
)}
</div>
</div>
</div>

View File

@@ -68,11 +68,9 @@ export function DownloadSettingsModal({
return true;
});
/* Gives preference to Real Debrid */
const selectedDownloader = filteredDownloaders.includes(
Downloader.RealDebrid
)
? Downloader.RealDebrid
/* Gives preference to TorBox */
const selectedDownloader = filteredDownloaders.includes(Downloader.TorBox)
? Downloader.TorBox
: filteredDownloaders[0];
setSelectedDownloader(