Skip to content

Commit

Permalink
Add new Minimum Availability setting for Radarr (#480)
Browse files Browse the repository at this point in the history
* Add new Minimum Availability setting for radarr
Version bump to 1.20.6

* Fix radarrQUALITYPROFILEID type mismatch with the declared type and defaultValue provided.
  • Loading branch information
RickyGrassmuck authored and lokenx committed Jun 24, 2017
1 parent ea2c74b commit 1ca69e3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
3 changes: 3 additions & 0 deletions client/templates/admin/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ <h1>Admin</h1>
<br>
<p class="text-muted">Select a Radarr Quality Profile.</p>
<br>
{{> afQuickField name='radarrMINAVAILABILITY' type='select'}}
<p class="text-muted">Select a Minimum Availability option.</p>
<br>
{{> afQuickField name='radarrROOTFOLDERPATH'}}
<p class="text-muted">Enter the root folder where movies are saved. For example C:\Media\TV.</p>
<br>
Expand Down
13 changes: 13 additions & 0 deletions lib/collections/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,19 @@ var settings = new SimpleSchema ({
defaultValue: "/path/to/root/movie/folder",
optional: true
},
radarrMINAVAILABILITY: {
type: String,
label: "Minimum availability before downloading",
allowedValues: ['preDB','announced','inCinemas','released'],
autoform: {
options: [
{label: 'PreDB', value: 'preDB'},
{label: 'Announced', value: 'announced'},
{label: 'In Theatre', value: 'inCinemas'},
{label: 'Released', value: 'released'}]
},
optional: true
},
radarrENABLED: {
type: Boolean,
label: "Enable Radarr",
Expand Down
2 changes: 1 addition & 1 deletion server/methods/admin/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Meteor.methods({
},

getVersion: function () {
return "1.20.5";
return "1.20.6";
},

checkForUpdate : function () {
Expand Down
6 changes: 5 additions & 1 deletion server/methods/helpers/movies/radarrMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ Meteor.methods({
check(request.id, Number);
check(request.title, String);
check(request.year, String);

check(settings.radarrQUALITYPROFILEID, Number);
check(settings.radarrROOTFOLDERPATH, String);
check(settings.radarrMINAVAILABILITY, String);

} catch (e) {
console.log("Radarr Movie Post -> " + e.message);
return false;
return false;
}
//Workaround to allow self-signed SSL certs, however can be dangerous and should not be used in production, looking into better way
//But it's possible there's nothing much I can do
Expand All @@ -55,6 +57,7 @@ Meteor.methods({
var options = {"searchForMovie": 'true'};

try {

var response = HTTP.post(Radarr.url + ":" + Radarr.port + Radarr.directory + "/api/movie", {
headers: {"X-Api-Key":Radarr.api},
data: {
Expand All @@ -63,6 +66,7 @@ Meteor.methods({
"year": request.year,
"qualityProfileId": settings.radarrQUALITYPROFILEID,
"rootFolderPath": settings.radarrROOTFOLDERPATH,
"minimumAvailability": settings.radarrMINAVAILABILITY,
"titleSlug": request.title,
"monitored": 'true',
"images": [],
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.5
1.20.6

0 comments on commit 1ca69e3

Please sign in to comment.