diff options
-rw-r--r-- | server/models/video.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/server/models/video.js b/server/models/video.js index 19136ba25..4f2be5c96 100644 --- a/server/models/video.js +++ b/server/models/video.js | |||
@@ -299,7 +299,12 @@ function load (id, callback) { | |||
299 | function search (value, field, start, count, sort, callback) { | 299 | function search (value, field, start, count, sort, callback) { |
300 | const query = {} | 300 | const query = {} |
301 | // Make an exact search with the magnet | 301 | // Make an exact search with the magnet |
302 | if (field === 'magnetUri' || field === 'tags') { | 302 | if (field === 'magnetUri') { |
303 | const infoHash = magnetUtil.decode(value).infoHash | ||
304 | query.magnet = { | ||
305 | infoHash | ||
306 | } | ||
307 | } else if (field === 'tags') { | ||
303 | query[field] = value | 308 | query[field] = value |
304 | } else { | 309 | } else { |
305 | query[field] = new RegExp(value, 'i') | 310 | query[field] = new RegExp(value, 'i') |