add stalled state in UI

This commit is contained in:
Ivan Sanz Carasa 2024-03-29 18:46:09 +01:00
parent 2ef0ddc0b7
commit 716d89680d
2 changed files with 11 additions and 5 deletions

View file

@ -38,8 +38,7 @@ export class TorrentStatusPipe implements PipeTransform {
speed = this.pipe.transform(allSpeeds, 'filesize'); speed = this.pipe.transform(allSpeeds, 'filesize');
return `Downloading file ${downloading.length + downloaded.length}/${ return `Downloading file ${downloading.length + downloaded.length}/${torrent.downloads.length
torrent.downloads.length
} (${progress.toFixed(2)}% - ${speed}/s)`; } (${progress.toFixed(2)}% - ${speed}/s)`;
} }
@ -87,6 +86,9 @@ export class TorrentStatusPipe implements PipeTransform {
switch (torrent.rdStatus) { switch (torrent.rdStatus) {
case RealDebridStatus.Downloading: case RealDebridStatus.Downloading:
if (torrent.rdSeeders < 1) {
return `Torrent stalled`
}
const speed = this.pipe.transform(torrent.rdSpeed, 'filesize'); const speed = this.pipe.transform(torrent.rdSpeed, 'filesize');
return `Torrent downloading (${torrent.rdProgress}% - ${speed}/s)`; return `Torrent downloading (${torrent.rdProgress}% - ${speed}/s)`;
case RealDebridStatus.Processing: case RealDebridStatus.Processing:

View file

@ -16,6 +16,7 @@
<th>Name</th> <th>Name</th>
<th>Category</th> <th>Category</th>
<th>Priority</th> <th>Priority</th>
<th>Seeders</th>
<th>Files</th> <th>Files</th>
<th>Downloads</th> <th>Downloads</th>
<th>Size</th> <th>Size</th>
@ -40,6 +41,9 @@
<td> <td>
{{ torrent.priority }} {{ torrent.priority }}
</td> </td>
<td>
{{ torrent.rdSeeders }}
</td>
<td> <td>
{{ torrent.files.length | number }} {{ torrent.files.length | number }}
</td> </td>