diff --git a/src/api/helper/radarr.js b/src/api/helper/radarr.js index 683235c..decbf9e 100644 --- a/src/api/helper/radarr.js +++ b/src/api/helper/radarr.js @@ -1 +1,27 @@ -// TODO: Add helper for Radarr Movie \ No newline at end of file +module.exports = buildRadarrMovie = (movie, radarr, searchNow = false) => { + if (radarr.profile === "0" || radarr.rootfolder === "0") { + console.log("Please set quality profile and default root folder in radarr config!"); + return undefined; + } + + let newMovie = { + title = movie.title, + tmdbId = movie.tmdbId, + qualityProfileId = parseInt(radarr.profile), + rootFolderPath = parseInt(radarr.rootfolder), + titleSlug = movie.titleSlug, + monitored = true, + year = movie.year, + images = movie.images, + minimumAvailability = radarr.minimumavailability + }; + + newMovie = { + ...newMovie, + addOptions: { + searchForMovie: searchNow + } + } + + return newMovie; +} diff --git a/src/api/helper/sonarr.js b/src/api/helper/sonarr.js index 50e5768..5be24e4 100644 --- a/src/api/helper/sonarr.js +++ b/src/api/helper/sonarr.js @@ -3,7 +3,7 @@ const tvmaze = new TVMaze(); module.exports = buildSonarrSeries = (series, sonarr) => { if (sonarr.profile === "0" || sonar.rootfolder === "0") { - console.log("Please set quality profiles and default root folders in sonarr config!"); + console.log("Please set quality profile and default root folder in sonarr config!"); return undefined; } @@ -46,4 +46,4 @@ module.exports = buildSonarrSeries = (series, sonarr) => { } return newSeries; -} \ No newline at end of file +}