Formatting fixes.
This commit is contained in:
parent
995cee66f3
commit
d172da80b5
1 changed files with 6 additions and 5 deletions
|
|
@ -209,6 +209,8 @@ public class QBittorrent
|
||||||
|
|
||||||
var prio = 0;
|
var prio = 0;
|
||||||
|
|
||||||
|
Decimal? downloadProgress = 0;
|
||||||
|
|
||||||
foreach (var torrent in torrents)
|
foreach (var torrent in torrents)
|
||||||
{
|
{
|
||||||
var downloadPath = savePath;
|
var downloadPath = savePath;
|
||||||
|
|
@ -224,10 +226,9 @@ public class QBittorrent
|
||||||
torrentPath = Path.Combine(downloadPath, torrent.RdName) + Path.DirectorySeparatorChar;
|
torrentPath = Path.Combine(downloadPath, torrent.RdName) + Path.DirectorySeparatorChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
Decimal? rdProgress = torrent.RdProgress / 100.0m;
|
var rdProgress = torrent.RdProgress / 100.0m;
|
||||||
Decimal? downloadProgress = 0;
|
|
||||||
var bytesTotal = torrent.RdSize;
|
var bytesTotal = torrent.RdSize;
|
||||||
var bytesDone = (long?)(torrent.RdSize * rdProgress);
|
var bytesDone = (Int64?)(torrent.RdSize * rdProgress);
|
||||||
var speed = torrent.RdSpeed ?? 0;
|
var speed = torrent.RdSpeed ?? 0;
|
||||||
|
|
||||||
if (torrent.Downloads.Count > 0)
|
if (torrent.Downloads.Count > 0)
|
||||||
|
|
@ -238,7 +239,7 @@ public class QBittorrent
|
||||||
downloadProgress = bytesTotal > 0 ? (Decimal?)bytesDone / bytesTotal : 0;
|
downloadProgress = bytesTotal > 0 ? (Decimal?)bytesDone / bytesTotal : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Decimal? progress = (rdProgress + downloadProgress) / 2m;
|
var progress = (rdProgress + downloadProgress) / 2m;
|
||||||
|
|
||||||
var result = new TorrentInfo
|
var result = new TorrentInfo
|
||||||
{
|
{
|
||||||
|
|
@ -268,7 +269,7 @@ public class QBittorrent
|
||||||
NumLeechs = 1,
|
NumLeechs = 1,
|
||||||
NumSeeds = torrent.RdSeeders ?? 1,
|
NumSeeds = torrent.RdSeeders ?? 1,
|
||||||
Priority = ++prio,
|
Priority = ++prio,
|
||||||
Progress = (float)(progress ?? 0),
|
Progress = (Single)(progress ?? 0),
|
||||||
Ratio = 1,
|
Ratio = 1,
|
||||||
RatioLimit = 1,
|
RatioLimit = 1,
|
||||||
SavePath = downloadPath,
|
SavePath = downloadPath,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue