From 93bcf21cca0ad48e33e440599b15802efa254f43 Mon Sep 17 00:00:00 2001 From: Quinten Stokkink Date: Wed, 16 Oct 2024 15:13:15 +0200 Subject: [PATCH] Fetch availability for download details --- src/tribler/ui/src/pages/Downloads/index.tsx | 2 +- src/tribler/ui/src/services/tribler.service.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tribler/ui/src/pages/Downloads/index.tsx b/src/tribler/ui/src/pages/Downloads/index.tsx index f24f000e83..d794189360 100644 --- a/src/tribler/ui/src/pages/Downloads/index.tsx +++ b/src/tribler/ui/src/pages/Downloads/index.tsx @@ -158,7 +158,7 @@ export default function Downloads({ statusFilter }: { statusFilter: number[] }) infohash = infohashes[0] ?? ""; // Don't bother the user on error, just try again later. - const response = await triblerService.getDownloads(infohash, !!infohash, !!infohash); + const response = await triblerService.getDownloads(infohash, !!infohash, !!infohash, !!infohash); if (response !== undefined && !isErrorDict(response)) { setDownloads(response.filter((download: Download) => { return statusFilter.includes(download.status_code); diff --git a/src/tribler/ui/src/services/tribler.service.ts b/src/tribler/ui/src/services/tribler.service.ts index 1d7846524b..2a8e25bd64 100644 --- a/src/tribler/ui/src/services/tribler.service.ts +++ b/src/tribler/ui/src/services/tribler.service.ts @@ -48,9 +48,9 @@ export class TriblerService { // Downloads - async getDownloads(infohash: string = '', getPeers: boolean = false, getPieces: boolean = false): Promise { + async getDownloads(infohash: string = '', getPeers: boolean = false, getPieces: boolean = false, getAvailability: boolean = false): Promise { try { - return (await this.http.get(`/downloads?infohash=${infohash}&get_peers=${+getPeers}&get_pieces=${+getPieces}`)).data.downloads; + return (await this.http.get(`/downloads?infohash=${infohash}&get_peers=${+getPeers}&get_pieces=${+getPieces}&get_availability=${+getAvailability}`)).data.downloads; } catch (error) { return formatAxiosError(error as Error | AxiosError); }