From f34cc0e0b0ccf51fe69f261d4b8325e1957f8acf Mon Sep 17 00:00:00 2001 From: pyed Date: Sat, 2 Jul 2016 08:20:40 +0300 Subject: [PATCH] sort: DownSpeed, UpSpeed --- transmission-telegram.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/transmission-telegram.go b/transmission-telegram.go index 7330d8f..a95fdaa 100644 --- a/transmission-telegram.go +++ b/transmission-telegram.go @@ -511,9 +511,9 @@ func errors(ud *tgbotapi.Update) { // sort changes torrents sorting func sort(ud *tgbotapi.Update, tokens []string) { if len(tokens) == 0 { - send(`sort takes one of (id, name, age, size, progress, download, upload, ratio) + send(`sort takes one of (id, name, age, size, progress, downspeed, upspeed, download, upload, ratio) optionally start with (rev) for reversed order - e.g. "sort rev size" to get smallest torrents first.`, ud.Message.Chat.ID) + e.g. "sort rev size" to get biggest torrents first.`, ud.Message.Chat.ID) return } @@ -554,6 +554,18 @@ func sort(ud *tgbotapi.Update, tokens []string) { break } Client.SetSort(transmission.SortProgress) + case "downspeed": + if reversed { + Client.SetSort(transmission.SortRevDownSpeed) + break + } + Client.SetSort(transmission.SortDownSpeed) + case "upspeed": + if reversed { + Client.SetSort(transmission.SortRevUpSpeed) + break + } + Client.SetSort(transmission.SortUpSpeed) case "download": if reversed { Client.SetSort(transmission.SortRevDownloaded)