mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Added the minimumAvailability #865
This commit is contained in:
parent
74f3e0f143
commit
b8f20cc187
10 changed files with 39 additions and 13 deletions
|
@ -10,6 +10,6 @@ namespace Ombi.Api.Radarr
|
||||||
Task<List<RadarrProfile>> GetProfiles(string apiKey, string baseUrl);
|
Task<List<RadarrProfile>> GetProfiles(string apiKey, string baseUrl);
|
||||||
Task<List<RadarrRootFolder>> GetRootFolders(string apiKey, string baseUrl);
|
Task<List<RadarrRootFolder>> GetRootFolders(string apiKey, string baseUrl);
|
||||||
Task<SystemStatus> SystemStatus(string apiKey, string baseUrl);
|
Task<SystemStatus> SystemStatus(string apiKey, string baseUrl);
|
||||||
Task<RadarrAddMovieResponse> AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath,string apiKey, string baseUrl, bool searchNow = false);
|
Task<RadarrAddMovieResponse> AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath,string apiKey, string baseUrl, bool searchNow, string minimumAvailability);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,6 +20,7 @@ namespace Ombi.Api.Radarr.Models
|
||||||
public string studio { get; set; }
|
public string studio { get; set; }
|
||||||
public string path { get; set; }
|
public string path { get; set; }
|
||||||
public int profileId { get; set; }
|
public int profileId { get; set; }
|
||||||
|
public string minimumAvailability { get; set; }
|
||||||
public bool monitored { get; set; }
|
public bool monitored { get; set; }
|
||||||
public int runtime { get; set; }
|
public int runtime { get; set; }
|
||||||
public string lastInfoSync { get; set; }
|
public string lastInfoSync { get; set; }
|
||||||
|
|
|
@ -22,6 +22,6 @@ namespace Ombi.Api.Radarr.Models
|
||||||
public string titleSlug { get; set; }
|
public string titleSlug { get; set; }
|
||||||
public int id { get; set; }
|
public int id { get; set; }
|
||||||
public int year { get; set; }
|
public int year { get; set; }
|
||||||
|
public string minimumAvailability { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -53,7 +53,7 @@ namespace Ombi.Api.Radarr
|
||||||
return await Api.Request<List<MovieResponse>>(request);
|
return await Api.Request<List<MovieResponse>>(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<RadarrAddMovieResponse> AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath, string apiKey, string baseUrl, bool searchNow = false)
|
public async Task<RadarrAddMovieResponse> AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath, string apiKey, string baseUrl, bool searchNow, string minimumAvailability)
|
||||||
{
|
{
|
||||||
var request = new Request("/api/movie", baseUrl, HttpMethod.Post);
|
var request = new Request("/api/movie", baseUrl, HttpMethod.Post);
|
||||||
|
|
||||||
|
@ -65,7 +65,8 @@ namespace Ombi.Api.Radarr
|
||||||
rootFolderPath = rootPath,
|
rootFolderPath = rootPath,
|
||||||
titleSlug = title,
|
titleSlug = title,
|
||||||
monitored = true,
|
monitored = true,
|
||||||
year = year
|
year = year,
|
||||||
|
minimumAvailability = minimumAvailability,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (searchNow)
|
if (searchNow)
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace Ombi.Core
|
||||||
|
|
||||||
//var rootFolderPath = model.RootFolderSelected <= 0 ? settings.FullRootPath : GetRootPath(model.RootFolderSelected, settings);
|
//var rootFolderPath = model.RootFolderSelected <= 0 ? settings.FullRootPath : GetRootPath(model.RootFolderSelected, settings);
|
||||||
var rootFolderPath = settings.DefaultRootPath; // TODO Allow changing in the UI
|
var rootFolderPath = settings.DefaultRootPath; // TODO Allow changing in the UI
|
||||||
var result = await RadarrApi.AddMovie(model.ProviderId, model.Title, model.ReleaseDate.Year, qualityProfile, rootFolderPath, settings.ApiKey, settings.FullUri, !settings.AddOnly);
|
var result = await RadarrApi.AddMovie(model.ProviderId, model.Title, model.ReleaseDate.Year, qualityProfile, rootFolderPath, settings.ApiKey, settings.FullUri, !settings.AddOnly, settings.MinimumAvailability);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(result.Error?.message))
|
if (!string.IsNullOrEmpty(result.Error?.message))
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,5 +9,6 @@ namespace Ombi.Settings.Settings.Models.External
|
||||||
public string DefaultQualityProfile { get; set; }
|
public string DefaultQualityProfile { get; set; }
|
||||||
public string DefaultRootPath { get; set; }
|
public string DefaultRootPath { get; set; }
|
||||||
public bool AddOnly { get; set; }
|
public bool AddOnly { get; set; }
|
||||||
|
public string MinimumAvailability { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,6 +11,11 @@ export interface IRadarrProfile {
|
||||||
items:IItem[],
|
items:IItem[],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IMinimumAvailability {
|
||||||
|
value: string,
|
||||||
|
name:string,
|
||||||
|
}
|
||||||
|
|
||||||
export interface ICutoff {
|
export interface ICutoff {
|
||||||
id: number,
|
id: number,
|
||||||
name:string,
|
name:string,
|
||||||
|
|
|
@ -61,6 +61,7 @@ export interface IRadarrSettings extends IExternalSettings {
|
||||||
defaultRootPath: string,
|
defaultRootPath: string,
|
||||||
fullRootPath: string,
|
fullRootPath: string,
|
||||||
addOnly: boolean,
|
addOnly: boolean,
|
||||||
|
minimumAvailability:string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ILandingPageSettings extends ISettings {
|
export interface ILandingPageSettings extends ISettings {
|
||||||
|
|
|
@ -15,8 +15,9 @@
|
||||||
<div *ngIf="form.get('apiKey').hasError('required')">The Api Key is required</div>
|
<div *ngIf="form.get('apiKey').hasError('required')">The Api Key is required</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div *ngIf="form.get('defaultQualityProfile').hasError('required')">A Default Quality Profile is required</div>
|
<div *ngIf="form.get('defaultQualityProfile').hasError('required')">A Default Quality Profile is required</div>
|
||||||
<div *ngIf="form.get('defaultRootPath').hasError('required')">A Default Root Path is required</div>
|
<div *ngIf="form.get('defaultRootPath').hasError('required')">A Default Root Path is required</div>
|
||||||
|
<div *ngIf="form.get('minimumAvailability').hasError('required')">A Default Minimum Availability is required</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -94,6 +95,15 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="rootFolders" class="control-label">Default Minimum Availability</label>
|
||||||
|
<div id="rootFolders">
|
||||||
|
<select formControlName="minimumAvailability" class="form-control form-control-custom">
|
||||||
|
<option *ngFor='let min of minimumAvailabilityOptions' value='{{min.value}}'>{{min.name}}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group" *ngIf="advanced">
|
<div class="form-group" *ngIf="advanced">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<input type="checkbox" id="addOnly" formControlName="addOnly">
|
<input type="checkbox" id="addOnly" formControlName="addOnly">
|
||||||
|
|
|
@ -4,7 +4,7 @@ import "rxjs/add/operator/takeUntil";
|
||||||
import { FormGroup, Validators, FormBuilder } from '@angular/forms';
|
import { FormGroup, Validators, FormBuilder } from '@angular/forms';
|
||||||
|
|
||||||
import { IRadarrSettings } from '../../interfaces/ISettings';
|
import { IRadarrSettings } from '../../interfaces/ISettings';
|
||||||
import { IRadarrProfile, IRadarrRootFolder } from '../../interfaces/IRadarr';
|
import { IRadarrProfile, IRadarrRootFolder, IMinimumAvailability } from '../../interfaces/IRadarr';
|
||||||
import { SettingsService } from '../../services/settings.service';
|
import { SettingsService } from '../../services/settings.service';
|
||||||
import { RadarrService } from '../../services/applications/radarr.service';
|
import { RadarrService } from '../../services/applications/radarr.service';
|
||||||
import { NotificationService } from "../../services/notification.service";
|
import { NotificationService } from "../../services/notification.service";
|
||||||
|
@ -19,7 +19,9 @@ export class RadarrComponent implements OnInit {
|
||||||
private fb: FormBuilder) { }
|
private fb: FormBuilder) { }
|
||||||
qualities: IRadarrProfile[];
|
qualities: IRadarrProfile[];
|
||||||
rootFolders: IRadarrRootFolder[];
|
rootFolders: IRadarrRootFolder[];
|
||||||
|
|
||||||
|
minimumAvailabilityOptions: IMinimumAvailability[];
|
||||||
|
|
||||||
profilesRunning: boolean;
|
profilesRunning: boolean;
|
||||||
rootFoldersRunning: boolean;
|
rootFoldersRunning: boolean;
|
||||||
|
|
||||||
|
@ -43,18 +45,23 @@ export class RadarrComponent implements OnInit {
|
||||||
ip: [x.ip, [Validators.required]],
|
ip: [x.ip, [Validators.required]],
|
||||||
port: [x.port, [Validators.required]],
|
port: [x.port, [Validators.required]],
|
||||||
addOnly: [x.addOnly],
|
addOnly: [x.addOnly],
|
||||||
|
minimumAvailability: [x.minimumAvailability, [Validators.required]]
|
||||||
});
|
});
|
||||||
|
|
||||||
if (x.defaultQualityProfile)
|
if (x.defaultQualityProfile) {
|
||||||
{
|
|
||||||
this.getProfiles(this.form);
|
this.getProfiles(this.form);
|
||||||
}
|
}
|
||||||
if (x.defaultRootPath)
|
if (x.defaultRootPath) {
|
||||||
{
|
|
||||||
this.getRootFolders(this.form);
|
this.getRootFolders(this.form);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.minimumAvailabilityOptions = [
|
||||||
|
{ name: "Announced", value:"Announced" },
|
||||||
|
{ name: "InCinemas", value:"In Cinemas" },
|
||||||
|
{ name: "Released", value:"Physical/Web" },
|
||||||
|
{ name: "PreDb", value:"PreDb" },
|
||||||
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue