Server: adapt magnet uri search
This commit is contained in:
parent
f285faa04e
commit
55723d16fd
|
@ -299,7 +299,12 @@ function load (id, callback) {
|
||||||
function search (value, field, start, count, sort, callback) {
|
function search (value, field, start, count, sort, callback) {
|
||||||
const query = {}
|
const query = {}
|
||||||
// Make an exact search with the magnet
|
// Make an exact search with the magnet
|
||||||
if (field === 'magnetUri' || field === 'tags') {
|
if (field === 'magnetUri') {
|
||||||
|
const infoHash = magnetUtil.decode(value).infoHash
|
||||||
|
query.magnet = {
|
||||||
|
infoHash
|
||||||
|
}
|
||||||
|
} else if (field === 'tags') {
|
||||||
query[field] = value
|
query[field] = value
|
||||||
} else {
|
} else {
|
||||||
query[field] = new RegExp(value, 'i')
|
query[field] = new RegExp(value, 'i')
|
||||||
|
|
Loading…
Reference in New Issue