mirror of
https://github.com/mjrode/WhatToWatch.git
synced 2026-05-07 21:19:08 -05:00
First pass at frontend Sonarr integration
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user