From ed1c0a21f824a3de1339936467dea5f5a5ee9158 Mon Sep 17 00:00:00 2001
From: Luminarys
Date: Wed, 14 Mar 2018 00:22:56 -0700
Subject: [PATCH 1/2] Add tracker searches
---
src/search.js | 5 ++++-
src/ui/search_help.js | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/search.js b/src/search.js
index d1f649b..33fe4dd 100644
--- a/src/search.js
+++ b/src/search.js
@@ -27,7 +27,10 @@ export function search_criteria(text) {
}
const [field, value] = t.split(op);
if (op == ":") {
- return { op: "ilike", field, value: `%${t}%` };
+ if (field == "tracker") {
+ return { op: "has", field: "tracker_urls", value };
+ }
+ return { op: "ilike", field, value };
}
if (!isNaN(numeral(value).value())) {
return {
diff --git a/src/ui/search_help.js b/src/ui/search_help.js
index 3c1bcac..2105daa 100644
--- a/src/ui/search_help.js
+++ b/src/ui/search_help.js
@@ -28,7 +28,9 @@ function SearchHelp(props) {
"throttle_down": "throttle down in bits/sec",
"transferred_up": "total transfer up in bits/sec",
"transferred_down": "total transfer down in bits/sec",
+ "tracker": "tracker url",
"peers": "number of peers",
+ "trackers": "number of trackers",
"files": "number of files",
};
@@ -70,6 +72,7 @@ function SearchHelp(props) {
{searchLink("files>1")}
{searchLink("files==1")}
{searchLink("progress<0.1")}
+ {searchLink("tracker:archlinux.org")}
);
From f9ece61f5094d038284736f916a7dc6241c77283 Mon Sep 17 00:00:00 2001
From: Luminarys
Date: Wed, 14 Mar 2018 00:31:43 -0700
Subject: [PATCH 2/2] Change example parameter from state to status
---
src/ui/search_help.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ui/search_help.js b/src/ui/search_help.js
index 2105daa..3be69ae 100644
--- a/src/ui/search_help.js
+++ b/src/ui/search_help.js
@@ -66,8 +66,8 @@ function SearchHelp(props) {
Here are some example searches:
- - {searchLink("state:seeding")}
- - {searchLink("state:leeching")}
+ - {searchLink("status:seeding")}
+ - {searchLink("status:idle")}
- {searchLink("rate_up>1048576")}
- {searchLink("files>1")}
- {searchLink("files==1")}