First pass at frontend Sonarr integration

This commit is contained in:
mjrode
2019-04-13 01:22:28 -05:00
parent 04065086f7
commit ce231c6c4f
5 changed files with 57 additions and 21 deletions
-15
View File
@@ -16,21 +16,6 @@ const addShow = async (req, res) => {
res.json(response);
};
// const similarTv = async (req, res) => {
// const {showName} = req.query;
// const searchResponse = await movieDbApi.searchTv(showName);
// const similarResponse = await movieDbApi.similarTV(searchResponse.id);
// const library = await models.PlexLibrary.findAll({
// userId: req.user.id,
// type: 'show',
// });
// const libraryTitles = library.map(show => show.title.toLowerCase());
// const filteredResponse = similarResponse.results.filter(
// show => !libraryTitles.includes(show.name.toLowerCase()),
// );
// res.json(filteredResponse);
// };
export default {
search,
addShow,
-4
View File
@@ -25,7 +25,6 @@ const addShow = async (showName, user) => {
const body = await search(showName, user);
body.profileId = 1;
const rootFolder = await getRootFolder(user);
console.log('mike---', JSON.parse(rootFolder)[0].path);
body.rootFolderPath = JSON.parse(rootFolder)[0].path;
const params = {
baseUrl: user.sonarrUrl,
@@ -35,12 +34,9 @@ const addShow = async (showName, user) => {
json: true,
};
console.log(params);
const res = await request.post(params);
console.log(res);
return res;
} catch (error) {
console.log('error--', error);
return error.error[0].errorMessage;
}
};