forked from Gabisonfire/dashboard-q
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtorrents_info.php
68 lines (68 loc) · 2.81 KB
/
torrents_info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<div class="row">
<!--Downloading Section-->
<div class="col-lg-6 col-md-3 col-sm-12 col-xs-12">
<div class="info-box blue-bg">
<h3>Downloading <span class="speeds">
<?php
if ($client == "qbittorent"){
echo round(intval($global_info['dl_info_speed'])/1000, 2) . " kB/s";
} elseif ($client == "transmission"){
echo round(intval($global_info['downloadSpeed'])/1000, 2) . " kB/s";
}
?>
</span></h3>
<?php
if($torrents == null){
echo "There was a problem fetching torrents.";
} else {
if ($client == "qbittorrent"){
foreach($torrents as $torrent){
if($torrent['state'] == "downloading"){
echo $torrent['name'] . "<br>";
}
}
} elseif ($client == "transmission"){
foreach($torrents['torrents'] as $torrent){
if($torrent['status'] == "4"){
echo $torrent['name'] . "<br>";
}
}
}
}
?>
</div><!--/.info-box-->
</div><!--/.col-->
<!--Seeding Section-->
<div class="col-lg-6 col-md-3 col-sm-12 col-xs-12">
<div class="info-box green-bg">
<h3>Seeding <span class="speeds">
<?php
if ($client == "qbittorent"){
echo round(intval($global_info['up_info_speed'])/1000, 2) . " kB/s";
} elseif ($client == "transmission"){
echo round(intval($global_info['uploadSpeed'])/1000, 2) . " kB/s";
}
?>
</span></h3>
<?php
if($torrents == null){
echo "There was a problem fetching torrents.";
} else {
if ($client == "qbittorrent"){
foreach($torrents as $torrent){
if($torrent['state'] == "uploading"){
echo $torrent['name'] . "<br>";
}
}
} elseif ($client == "transmission"){
foreach($torrents['torrents'] as $torrent){
if($torrent['status'] == "6" && $torrent['peersGettingFromUs'] != "0"){
echo $torrent['name'] . "<br>";
}
}
}
}
?>
</div><!--/.info-box-->
</div><!--/.col-->
</div><!--/.row-->