Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #114 from v0idp/develop
Browse files Browse the repository at this point in the history
you can now set if the movie or tv show will be searched on sonarr/ra…
  • Loading branch information
v0idp authored Feb 28, 2020
2 parents bc5c26d + e89c94f commit 46a6d80
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/settings.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"general":{"username":"mellow","password":"$2a$10$hKxfwH5lKDxogjIPKR.9mOJi664EQ298OYiRt/HuqVjSHw8BRKEya"},"bot":{"token":"","ownerid":"","commandprefix":"","channelname":"","deletecommandmessages":"false","unknowncommandresponse":"false","defaultservice":"ombi","requesttv":"","requestmovie":"","admin":"","selection":"emoji"},"ombi":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false","username":""},"tautulli":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false"},"sonarr":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false","profile":"0","profileanime":"0","rootfolder":"","rootfolderanime":"","languageprofile":"0","seasonfolders":"false","v3":"false"},"radarr":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false","profile":"0","rootfolder":"","minimumavailability":"Announced"}}
{"general":{"username":"mellow","password":"$2a$10$hKxfwH5lKDxogjIPKR.9mOJi664EQ298OYiRt/HuqVjSHw8BRKEya"},"bot":{"token":"","ownerid":"","commandprefix":"","channelname":"","deletecommandmessages":"false","unknowncommandresponse":"false","defaultservice":"ombi","requesttv":"","requestmovie":"","admin":"","selection":"emoji"},"ombi":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false","username":""},"tautulli":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false"},"sonarr":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false","profile":"0","profileanime":"0","rootfolder":"","rootfolderanime":"","languageprofile":"0","seasonfolders":"false","v3":"false","searchonrequest":"false"},"radarr":{"host":"","port":"","baseurl":"","apikey":"","ssl":"false","profile":"0","rootfolder":"","minimumavailability":"Announced","searchonrequest":"false"}}
4 changes: 2 additions & 2 deletions src/api/helpers/radarr.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = buildRadarrMovie = (movie, radarr, searchNow = false) => {
module.exports = buildRadarrMovie = (movie, radarr) => {
if (radarr.profile === "0" || radarr.rootfolder === "0" || radarr.rootfolder === "") {
const errMsg = 'Please set quality profile and default root folder in radarr config!';
console.log(errMsg);
Expand All @@ -20,7 +20,7 @@ module.exports = buildRadarrMovie = (movie, radarr, searchNow = false) => {

Object.assign(newMovie, {
addOptions: {
searchForMovie: searchNow
searchForMovie: (radarr.searchonrequest === "true") ? true : false
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/api/helpers/sonarr.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const TVMaze = require('../tvmaze.js');
const tvmaze = new TVMaze();

module.exports = buildSonarrSeries = (series, sonarr, searchNow = false) => {
module.exports = buildSonarrSeries = (series, sonarr) => {
if (sonarr.profile === "0" || sonarr.rootfolder === "0" || sonarr.rootfolder === "") {
const errMsg = 'Please set quality profile and default root folder in sonarr config!';
console.log(errMsg);
Expand Down Expand Up @@ -45,7 +45,7 @@ module.exports = buildSonarrSeries = (series, sonarr, searchNow = false) => {
addOptions: {
ignoreEpisodesWithFiles: true,
ignoreEpisodesWithoutFiles: false,
searchForMissingEpisodes: searchNow
searchForMissingEpisodes: (sonarr.searchonrequest === "true") ? true : false
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/bots/services/radarr.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = class SonarrService {
}

addMovie(msg, msgEmbed, movie) {
const newMovie = buildRadarrMovie(movie, this.client.db.config['radarr'], true);
const newMovie = buildRadarrMovie(movie, this.client.db.config['radarr']);
if (typeof newMovie === "string") {
return this.client.reply(msg, newMovie);
}
Expand Down
2 changes: 1 addition & 1 deletion src/bots/services/sonarr.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = class SonarrService {
}

addSeries(msg, msgEmbed, series) {
const newSeries = buildSonarrSeries(series, this.client.db.config['sonarr'], true);
const newSeries = buildSonarrSeries(series, this.client.db.config['sonarr']);
if (typeof newSeries === "string") {
return this.client.reply(msg, newSeries);
}
Expand Down
2 changes: 2 additions & 0 deletions src/database/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ module.exports = class Database {
newWebConfig.sonarr.languageprofile = request.body.languageprofile;
newWebConfig.sonarr.seasonfolders = (request.body.seasonfolders) ? 'true' : 'false';
newWebConfig.sonarr.v3 = (request.body.v3) ? 'true' : 'false';
newWebConfig.sonarr.searchonrequest = (request.body.searchonrequest) ? 'true' : 'false';
} else if (request.originalUrl == '/radarr' && request.body.apiKey != '' && request.body.host != '') {
newWebConfig.radarr.host = request.body.host;
newWebConfig.radarr.port = request.body.port;
Expand All @@ -82,6 +83,7 @@ module.exports = class Database {
newWebConfig.radarr.profile = request.body.profile;
newWebConfig.radarr.rootfolder = request.body.rootfolder;
newWebConfig.radarr.minimumavailability = request.body.minimumavailability;
newWebConfig.radarr.searchonrequest = (request.body.searchonrequest) ? 'true' : 'false';
}
if (request.body)
storeData(newWebConfig);
Expand Down
6 changes: 4 additions & 2 deletions src/database/settings_format.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"rootfolderanime": "",
"languageprofile": "0",
"seasonfolders": "false",
"v3": "false"
"v3": "false",
"searchonrequest": "false"
},
"radarr": {
"host": "",
Expand All @@ -53,6 +54,7 @@
"ssl": "false",
"profile": "0",
"rootfolder": "",
"minimumavailability": "Announced"
"minimumavailability": "Announced",
"searchonrequest": "false"
}
}
7 changes: 7 additions & 0 deletions src/web/views/tabs/radarr.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@
</select>
</div>
</div>

<div class="form-group row">
<label for="searchonrequest" class="col-md-4 form-check-label">Search On Request</label>
<div class="col-md-8">
<input type="checkbox" class="searchonrequest" name="searchonrequest" value="true" <% if (radarrSettings && radarrSettings.searchonrequest === 'true') { %>checked<% } %>>
</div>
</div>
</div>
</div>

Expand Down
7 changes: 7 additions & 0 deletions src/web/views/tabs/sonarr.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@
<input type="checkbox" class="seasonfolders" name="seasonfolders" value="true" <% if (sonarrSettings && sonarrSettings.seasonfolders === 'true') { %>checked<% } %>>
</div>
</div>

<div class="form-group row">
<label for="searchonrequest" class="col-md-4 form-check-label">Search On Request</label>
<div class="col-md-8">
<input type="checkbox" class="searchonrequest" name="searchonrequest" value="true" <% if (sonarrSettings && sonarrSettings.searchonrequest === 'true') { %>checked<% } %>>
</div>
</div>
</div>
</div>

Expand Down

0 comments on commit 46a6d80

Please sign in to comment.