Skip to content

Commit

Permalink
show different progress bar for seeding torrents in transmission plugin
Browse files Browse the repository at this point in the history
add option to auto delete completed torrents in transmission plugin
  • Loading branch information
lamarios committed May 26, 2017
1 parent fd6e448 commit 87325fd
Show file tree
Hide file tree
Showing 24 changed files with 134 additions and 50 deletions.
2 changes: 1 addition & 1 deletion models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.ftpix.homedash</groupId>
<artifactId>homedash</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>models</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion notifications/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>homedash</artifactId>
<groupId>com.ftpix.homedash</groupId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion plugins/couchpotato/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>couchpotato</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugins/docker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>docker</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugins/dockercompose/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>plugins</artifactId>
<groupId>com.ftpix.homedash.plugins</groupId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion plugins/dynamicdns/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>dynamicdns</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugins/googlepubliccalendar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version> </parent>
<version>1.0.21</version> </parent>

<artifactId>googlepubliccalendar</artifactId>
<name>googlepubliccalendar</name>
Expand Down
2 changes: 1 addition & 1 deletion plugins/harddisk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>harddisk</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugins/mma/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version> </parent>
<version>1.0.21</version> </parent>

<artifactId>mma</artifactId>
<name>mma</name>
Expand Down
2 changes: 1 addition & 1 deletion plugins/network-monitor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>networkmonitor</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pihole/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version> </parent>
<version>1.0.21</version> </parent>

<artifactId>pihole</artifactId>
<name>pihole</name>
Expand Down
2 changes: 1 addition & 1 deletion plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>homedash</artifactId>
<groupId>com.ftpix.homedash</groupId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion plugins/portmapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version> </parent>
<version>1.0.21</version> </parent>

<artifactId>portmapper</artifactId>
<name>portmapper</name>
Expand Down
2 changes: 1 addition & 1 deletion plugins/sonarrtv/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>sonarrtv</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugins/systeminfo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>systeminfo</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugins/transmission/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.ftpix.homedash.plugins</groupId>
<artifactId>plugins</artifactId>
<version>1.0.20</version> </parent>
<version>1.0.21</version> </parent>

<artifactId>transmission</artifactId>
<name>transmission</name>
Expand Down
36 changes: 28 additions & 8 deletions plugins/transmission/src/main/java/assets/js/transmission.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ function transmission(moduleId) {
var percent = Math.ceil(torrent.percentDone * 100);

var selected = this.selection.indexOf(torrent.id) !== -1;
var maxUpload = torrent.totalSize * torrent.seedRatioLimit;

var percentUploaded = Math.ceil((torrent.uploaded / maxUpload) * 100);

html.push('<div class="torrent-row ', multipleSelect, '" data-id="', torrent.id, '" >');
html.push('<div class="torrent-checkbox">');
Expand All @@ -306,18 +309,35 @@ function transmission(moduleId) {
html.push(this.getStatusIcon(torrent.status, rpcVersion), ' ');
html.push('<strong>', torrent.name, '</strong>');
html.push('</p>');
html.push('<div class="progress small-progress-bar">');
html.push('<div class="progress-bar" role="progressbar" aria-valuenow="', percent,
'" aria-valuemin="0" aria-valuemax="100" style="width: ', percent, '%;">');
//html.push('<span class="sr-only">', percent, '% Complete</span>');
//downloading torrent
if (percent < 100) {
html.push('<div class="progress small-progress-bar">');
html.push('<div class="progress-bar" role="progressbar" aria-valuenow="', percent,
'" aria-valuemin="0" aria-valuemax="100" style="width: ', percent, '%;">');
} else {
//seeding torrent
html.push('<div class="progress small-progress-bar seeding">');
html.push('<div class="progress-bar" role="progressbar" aria-valuenow="', percentUploaded,
'" aria-valuemin="0" aria-valuemax="100" style="width: ', percentUploaded, '%;">');

}

html.push('</div>');
html.push('</div>');
html.push('<p>');
html.push('DL: ', this.humanFileSize(torrent.downloadSpeed, true), '/s | Ul: ',
this.humanFileSize(torrent.uploadSpeed, true), '/s');
html.push('<span style="float:right">');
html.push(this.humanFileSize(torrent.downloaded, true), '/',
this.humanFileSize(torrent.totalSize, true));

//downloading torrent
if (percent < 100) {
html.push(this.humanFileSize(torrent.downloaded, true), '/',
this.humanFileSize(torrent.totalSize, true));
} else {
//torrent is now seeding
html.push(this.humanFileSize(torrent.uploaded, true), '/',
this.humanFileSize(maxUpload, true));
}
html.push('</span>');
html.push('</p>');
html.push('</div>'); //.torrent
Expand Down Expand Up @@ -408,9 +428,9 @@ function transmission(moduleId) {

this.removeTorrent = function (ids) {
if (confirm("Remove torrent ?")) {
if(confirm("Delete downloaded data as well ?")) {
if (confirm("Delete downloaded data as well ?")) {
sendMessage(this.moduleId, 'removeTorrentDelete', ids);
}else {
} else {
sendMessage(this.moduleId, 'removeTorrent', ids);
}
}
Expand Down
11 changes: 10 additions & 1 deletion plugins/transmission/src/main/java/assets/less/transmission.less
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,15 @@
width: 95%;
}
}

.progress.seeding {
@accentColor: #e67e22;
background-color: @accentColor;

.progress-bar {
background-color: darken(@accentColor, 10%);
}
}
}

.module-overlay {
Expand Down Expand Up @@ -269,7 +278,7 @@
text-align: center;
font-size: 20px;

p{
p {
margin: 6px;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,18 @@
input.form-control(type="password", id="password", name="password", placeholder="", value='#{settings.get("password")}')
else
input.form-control(type="password", id="password", name ="password", placeholder = "")
hr
.form-group
label
if settings && settings.containsKey("autoDelete")
input(type="checkbox", name="autoDelete", value="1", checked = "true")
else
input(type="checkbox", name="autoDelete", value="1")
span Delete torrents automatically that are completed (reach upload ratio or seeding time limit, ie: in paused status and download completed)
.form-group
label
if settings && settings.containsKey("autoRemoveFile")
input(type="checkbox", name="autoRemoveFile", value="1", checked = "true")
else
input(type="checkbox", name="autoRemoveFile", value="1")
span Also delete files when torrents are deleted automatically ?
Loading

0 comments on commit 87325fd

Please sign in to comment.