Skip to content

Commit

Permalink
Fetch availability for download details (#8220)
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink authored Oct 16, 2024
2 parents 9198977 + 93bcf21 commit 41620ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tribler/ui/src/pages/Downloads/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/tribler/ui/src/services/tribler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export class TriblerService {

// Downloads

async getDownloads(infohash: string = '', getPeers: boolean = false, getPieces: boolean = false): Promise<undefined | ErrorDict | Download[]> {
async getDownloads(infohash: string = '', getPeers: boolean = false, getPieces: boolean = false, getAvailability: boolean = false): Promise<undefined | ErrorDict | Download[]> {
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);
}
Expand Down

0 comments on commit 41620ed

Please sign in to comment.