mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
huh
This commit is contained in:
parent
9e6143ebc9
commit
94a6c14bd9
2 changed files with 15 additions and 7 deletions
|
@ -317,18 +317,24 @@ export class DownloadManager {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case Downloader.AllDebrid: {
|
case Downloader.AllDebrid: {
|
||||||
const downloadUrls = await AllDebridClient.getDownloadUrls(download.uri);
|
const downloadUrls = await AllDebridClient.getDownloadUrls(
|
||||||
|
download.uri
|
||||||
|
);
|
||||||
|
|
||||||
if (!downloadUrls.length) throw new Error(DownloadError.NotCachedInAllDebrid);
|
if (!downloadUrls.length)
|
||||||
|
throw new Error(DownloadError.NotCachedInAllDebrid);
|
||||||
|
|
||||||
const totalSize = downloadUrls.reduce((total, url) => total + (url.size || 0), 0);
|
const totalSize = downloadUrls.reduce(
|
||||||
|
(total, url) => total + (url.size || 0),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
action: "start",
|
action: "start",
|
||||||
game_id: downloadId,
|
game_id: downloadId,
|
||||||
url: downloadUrls.map(d => d.link),
|
url: downloadUrls.map((d) => d.link),
|
||||||
save_path: download.downloadPath,
|
save_path: download.downloadPath,
|
||||||
total_size: totalSize
|
total_size: totalSize,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case Downloader.Torrent:
|
case Downloader.Torrent:
|
||||||
|
|
4
src/renderer/src/declaration.d.ts
vendored
4
src/renderer/src/declaration.d.ts
vendored
|
@ -151,7 +151,9 @@ declare global {
|
||||||
minimized: boolean;
|
minimized: boolean;
|
||||||
}) => Promise<void>;
|
}) => Promise<void>;
|
||||||
authenticateRealDebrid: (apiToken: string) => Promise<RealDebridUser>;
|
authenticateRealDebrid: (apiToken: string) => Promise<RealDebridUser>;
|
||||||
authenticateAllDebrid: (apiKey: string) => Promise<AllDebridUser | { error_code: string }>;
|
authenticateAllDebrid: (
|
||||||
|
apiKey: string
|
||||||
|
) => Promise<AllDebridUser | { error_code: string }>;
|
||||||
authenticateTorBox: (apiToken: string) => Promise<TorBoxUser>;
|
authenticateTorBox: (apiToken: string) => Promise<TorBoxUser>;
|
||||||
onAchievementUnlocked: (cb: () => void) => () => Electron.IpcRenderer;
|
onAchievementUnlocked: (cb: () => void) => () => Electron.IpcRenderer;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue