Added endpoints for plex searching

This commit is contained in:
2017-04-14 18:54:30 +02:00
parent c6fa89f0fa
commit 16c89ab6e7
3 changed files with 45 additions and 8 deletions

View File

@@ -0,0 +1,23 @@
const assert = require('assert');
var request = require('request');
class PlexRepository {
read(strayId) {
return this.database.get(this.queries.read, strayId).then((row) => {
assert.notEqual(row, undefined, `Could not find list with id ${strayId}.`);
return row;
})
}
searchMedia(query) {
request
.get('10.0.0.41:32400/search?query=' + query)
.on('response', function(response) {
console.log(response.statusCode);
return response;
})
}
}
module.exports = PlexRepository;