merge declaration and initialisation of speed in TorrentStatusPipe

This commit is contained in:
Cucumberrbob 2025-06-07 18:41:06 +01:00
parent 08c1750def
commit f5f2760f80
No known key found for this signature in database
GPG key ID: 2B935C47401C3614

View file

@ -2,7 +2,7 @@ import { Pipe, PipeTransform } from '@angular/core';
import { RealDebridStatus, Torrent } from './models/torrent.model';
import { FileSizePipe } from './filesize.pipe';
@Pipe({ name: 'status', })
@Pipe({ name: 'status' })
export class TorrentStatusPipe implements PipeTransform {
constructor(private pipe: FileSizePipe) {}
@ -32,9 +32,7 @@ export class TorrentStatusPipe implements PipeTransform {
let allSpeeds = downloading.reduce((sum, m) => sum + m.speed, 0);
let speed: string | string[] = '0';
speed = this.pipe.transform(allSpeeds, 'filesize');
const speed: string | string[] = this.pipe.transform(allSpeeds, 'filesize');
return `Downloading file ${downloading.length + downloaded.length}/${
torrent.downloads.length