Fixed #1631 and improved translation support

Included startup args for the auto updater #1460
Mark TV requests as available #1632
pull/1648/head^2
tidusjar 7 years ago
parent 2d77be0478
commit 37617eb04d

@ -274,6 +274,13 @@ namespace Ombi.Core.Engine
}; };
} }
request.Available = false; request.Available = false;
foreach (var season in request.SeasonRequests)
{
foreach (var e in season.Episodes)
{
e.Available = false;
}
}
await TvRepository.UpdateChild(request); await TvRepository.UpdateChild(request);
NotificationHelper.Notify(request, NotificationType.RequestAvailable); NotificationHelper.Notify(request, NotificationType.RequestAvailable);
return new RequestEngineResult return new RequestEngineResult
@ -285,7 +292,7 @@ namespace Ombi.Core.Engine
public async Task<RequestEngineResult> MarkAvailable(int modelId) public async Task<RequestEngineResult> MarkAvailable(int modelId)
{ {
var request = await TvRepository.GetChild().FirstOrDefaultAsync(x => x.Id == modelId); ChildRequests request = await TvRepository.GetChild().FirstOrDefaultAsync(x => x.Id == modelId);
if (request == null) if (request == null)
{ {
return new RequestEngineResult return new RequestEngineResult
@ -294,6 +301,13 @@ namespace Ombi.Core.Engine
}; };
} }
request.Available = true; request.Available = true;
foreach (var season in request.SeasonRequests)
{
foreach (var e in season.Episodes)
{
e.Available = true;
}
}
await TvRepository.UpdateChild(request); await TvRepository.UpdateChild(request);
NotificationHelper.Notify(request, NotificationType.RequestAvailable); NotificationHelper.Notify(request, NotificationType.RequestAvailable);
return new RequestEngineResult return new RequestEngineResult

@ -19,6 +19,8 @@ using Ombi.Api.Service.Models;
using Ombi.Core.Settings; using Ombi.Core.Settings;
using Ombi.Helpers; using Ombi.Helpers;
using Ombi.Settings.Settings.Models; using Ombi.Settings.Settings.Models;
using Ombi.Store.Entities;
using Ombi.Store.Repository;
using Ombi.Updater; using Ombi.Updater;
using SharpCompress.Readers; using SharpCompress.Readers;
using SharpCompress.Readers.Tar; using SharpCompress.Readers.Tar;
@ -28,12 +30,13 @@ namespace Ombi.Schedule.Jobs.Ombi
public class OmbiAutomaticUpdater : IOmbiAutomaticUpdater public class OmbiAutomaticUpdater : IOmbiAutomaticUpdater
{ {
public OmbiAutomaticUpdater(ILogger<OmbiAutomaticUpdater> log, IOmbiService service, public OmbiAutomaticUpdater(ILogger<OmbiAutomaticUpdater> log, IOmbiService service,
ISettingsService<UpdateSettings> s, IProcessProvider proc) ISettingsService<UpdateSettings> s, IProcessProvider proc, IRepository<ApplicationConfiguration> appConfig)
{ {
Logger = log; Logger = log;
OmbiService = service; OmbiService = service;
Settings = s; Settings = s;
_processProvider = proc; _processProvider = proc;
_appConfig = appConfig;
} }
private ILogger<OmbiAutomaticUpdater> Logger { get; } private ILogger<OmbiAutomaticUpdater> Logger { get; }
@ -41,6 +44,7 @@ namespace Ombi.Schedule.Jobs.Ombi
private ISettingsService<UpdateSettings> Settings { get; } private ISettingsService<UpdateSettings> Settings { get; }
private readonly IProcessProvider _processProvider; private readonly IProcessProvider _processProvider;
private static PerformContext Ctx { get; set; } private static PerformContext Ctx { get; set; }
private readonly IRepository<ApplicationConfiguration> _appConfig;
public string[] GetVersion() public string[] GetVersion()
{ {
@ -182,13 +186,15 @@ namespace Ombi.Schedule.Jobs.Ombi
} }
var updaterFile = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), var updaterFile = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
"TempUpdate", $"Ombi.Updater{updaterExtension}"); "TempUpdate", $"Ombi.Updater{updaterExtension}");
// There must be an update // There must be an update
var start = new ProcessStartInfo var start = new ProcessStartInfo
{ {
UseShellExecute = false, UseShellExecute = false,
CreateNoWindow = true, CreateNoWindow = true,
FileName = updaterFile, FileName = updaterFile,
Arguments = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + " " + (settings.ProcessName.HasValue() ? settings.ProcessName : "Ombi"), Arguments = GetArgs(settings),
WorkingDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "TempUpdate"), WorkingDirectory = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "TempUpdate"),
}; };
if (settings.Username.HasValue()) if (settings.Username.HasValue())
@ -213,6 +219,18 @@ namespace Ombi.Schedule.Jobs.Ombi
} }
} }
private string GetArgs(UpdateSettings settings)
{
var config = _appConfig.GetAll();
var url = config.FirstOrDefault(x => x.Type == ConfigurationTypes.Url);
var storage = config.FirstOrDefault(x => x.Type == ConfigurationTypes.StoragePath);
var currentLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var processName = (settings.ProcessName.HasValue() ? settings.ProcessName : "Ombi");
return string.Join(" ", currentLocation, processName, url, storage);
}
private void RunScript(UpdateSettings settings, string downloadUrl) private void RunScript(UpdateSettings settings, string downloadUrl)
{ {
var scriptToRun = settings.ScriptLocation; var scriptToRun = settings.ScriptLocation;
@ -230,7 +248,7 @@ namespace Ombi.Schedule.Jobs.Ombi
var ombiProcess = _processProvider.FindProcessByName(settings.ProcessName).FirstOrDefault(); var ombiProcess = _processProvider.FindProcessByName(settings.ProcessName).FirstOrDefault();
var currentInstallLocation = Assembly.GetEntryAssembly().Location; var currentInstallLocation = Assembly.GetEntryAssembly().Location;
_processProvider.Start(scriptToRun, string.Join(" ", downloadUrl, ombiProcess.Id, currentInstallLocation)); _processProvider.Start(scriptToRun, downloadUrl + " " + ombiProcess.Id + " " + GetArgs(settings));
Logger.LogInformation("Script started"); Logger.LogInformation("Script started");
} }

@ -56,7 +56,8 @@ namespace Ombi.Updater
{ {
UseShellExecute = false, UseShellExecute = false,
FileName = Path.Combine(options.ApplicationPath,fileName), FileName = Path.Combine(options.ApplicationPath,fileName),
WorkingDirectory = options.ApplicationPath WorkingDirectory = options.ApplicationPath,
Arguments = options.StartupArgs
}; };
using (var proc = new Process { StartInfo = start }) using (var proc = new Process { StartInfo = start })
{ {

@ -72,6 +72,14 @@ namespace Ombi.Updater
ApplicationPath = args[0], ApplicationPath = args[0],
ProcessName = args[1], ProcessName = args[1],
}; };
if (args.Length == 4)
{
startup.StartupArgs = args[2] + " " + args[3];
}
else if (args.Length == 3)
{
startup.StartupArgs = args[2];
}
var p = new ProcessProvider(); var p = new ProcessProvider();
var ombiProc = p.FindProcessByName(startup.ProcessName).FirstOrDefault(); var ombiProc = p.FindProcessByName(startup.ProcessName).FirstOrDefault();
@ -87,5 +95,6 @@ namespace Ombi.Updater
public string ProcessName { get; set; } public string ProcessName { get; set; }
public string ApplicationPath { get; set; } public string ApplicationPath { get; set; }
public int OmbiProcessId { get; set; } public int OmbiProcessId { get; set; }
public string StartupArgs { get; set; }
} }
} }

@ -72,7 +72,7 @@
</li> </li>
<li [routerLinkActive]="['active']"> <li [routerLinkActive]="['active']">
<a (click)="logOut()"> <a (click)="logOut()">
<i class="fa fa-sign-out"></i> {{ 'NavigationBar.UpdateDetails' | translate }}</a> <i class="fa fa-sign-out"></i> {{ 'NavigationBar.Logout' | translate }}</a>
</li> </li>
</ul> </ul>
</li> </li>

@ -1,6 +1,7 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { ActivatedRoute, Router } from "@angular/router"; import { ActivatedRoute, Router } from "@angular/router";
import { TranslateService } from "@ngx-translate/core";
import { PlatformLocation } from "@angular/common"; import { PlatformLocation } from "@angular/common";
import { AuthService } from "../auth/auth.service"; import { AuthService } from "../auth/auth.service";
@ -23,10 +24,13 @@ export class LoginComponent implements OnInit {
public background: any; public background: any;
public landingFlag: boolean; public landingFlag: boolean;
public baseUrl: string; public baseUrl: string;
private errorBody: string;
private errorValidation: string;
constructor(private authService: AuthService, private router: Router, private notify: NotificationService, private status: StatusService, constructor(private authService: AuthService, private router: Router, private notify: NotificationService, private status: StatusService,
private fb: FormBuilder, private settingsService: SettingsService, private images: ImageService, private sanitizer: DomSanitizer, private fb: FormBuilder, private settingsService: SettingsService, private images: ImageService, private sanitizer: DomSanitizer,
private route: ActivatedRoute, private location: PlatformLocation) { private route: ActivatedRoute, private location: PlatformLocation, private readonly translate: TranslateService) {
this.route.params this.route.params
.subscribe((params: any) => { .subscribe((params: any) => {
this.landingFlag = params.landing; this.landingFlag = params.landing;
@ -61,11 +65,14 @@ export class LoginComponent implements OnInit {
if (base.length > 1) { if (base.length > 1) {
this.baseUrl = base; this.baseUrl = base;
} }
this.translate.get("Login.Errors.IncorrectCredentials").subscribe(x => this.errorBody = x);
this.translate.get("Common.Errors.Validation").subscribe(x => this.errorValidation = x);
} }
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notify.error("Validation", "Please check your entered values"); this.notify.error(this.errorValidation);
return; return;
} }
const value = form.value; const value = form.value;
@ -76,9 +83,9 @@ export class LoginComponent implements OnInit {
if (this.authService.loggedIn()) { if (this.authService.loggedIn()) {
this.router.navigate(["search"]); this.router.navigate(["search"]);
} else { } else {
this.notify.error("Could not log in", "Incorrect username or password"); this.notify.error(this.errorBody);
} }
}, err => this.notify.error("Could not log in", "Incorrect username or password")); }, err => this.notify.error(this.errorBody));
} }
} }

@ -2,7 +2,8 @@
you can substitue the span of reauth email for a input with the email and you can substitue the span of reauth email for a input with the email and
include the remember me checkbox include the remember me checkbox
--> -->
<div *ngIf="form && customizationSettings"> <div *ngIf="form && customizationSettings && background">
<img class="landingDiv bg" [style.background-image]="background" />
<div class="container" id="login"> <div class="container" id="login">
<div class="card card-container"> <div class="card card-container">
<!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> --> <!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> -->
@ -11,8 +12,8 @@ include the remember me checkbox
<p id="profile-name" class="profile-name-card"></p> <p id="profile-name" class="profile-name-card"></p>
<form class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)"> <form class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
<input type="email" id="inputEmail" class="form-control" formControlName="email" [attr.placeholder]="'ResetPassword.EmailAddressPlaceholder' | translate" autofocus> <input type="email" id="inputEmail" class="form-control" formControlName="email" [attr.placeholder]="'PasswordReset.EmailAddressPlaceholder' | translate" autofocus>
<button class="btn btn-success-outline" [disabled]="form.invalid" type="submit" [translate]="'ResetPassword.ResetPasswordButton'"></button> <button class="btn btn-success-outline" [disabled]="form.invalid" type="submit" [translate]="'PasswordReset.ResetPasswordButton'"></button>
</form><!-- /form --> </form><!-- /form -->
</div><!-- /card-container --> </div><!-- /card-container -->

@ -1,11 +1,10 @@
import { PlatformLocation } from "@angular/common"; import { PlatformLocation } from "@angular/common";
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { DomSanitizer } from "@angular/platform-browser";
import { ICustomizationSettings, IEmailNotificationSettings } from "../interfaces"; import { ICustomizationSettings } from "../interfaces";
import { IdentityService } from "../services"; import { IdentityService, ImageService,NotificationService, SettingsService } from "../services";
import { NotificationService } from "../services";
import { SettingsService } from "../services";
@Component({ @Component({
templateUrl: "./resetpassword.component.html", templateUrl: "./resetpassword.component.html",
@ -15,30 +14,35 @@ export class ResetPasswordComponent implements OnInit {
public form: FormGroup; public form: FormGroup;
public customizationSettings: ICustomizationSettings; public customizationSettings: ICustomizationSettings;
public emailSettings: IEmailNotificationSettings; public emailSettingsEnabled: boolean;
public baseUrl: string; public baseUrl: string;
public background: any;
constructor(private identityService: IdentityService, private notify: NotificationService, constructor(private identityService: IdentityService, private notify: NotificationService,
private fb: FormBuilder, private settingsService: SettingsService, private location: PlatformLocation) { private fb: FormBuilder, private settingsService: SettingsService, private location: PlatformLocation,
private images: ImageService, private sanitizer: DomSanitizer) {
this.form = this.fb.group({ this.form = this.fb.group({
email: ["", [Validators.required]], email: ["", [Validators.required]],
}); });
} }
public ngOnInit() { public ngOnInit() {
this.images.getRandomBackground().subscribe(x => {
this.background = this.sanitizer.bypassSecurityTrustStyle("linear-gradient(-10deg, transparent 20%, rgba(0,0,0,0.7) 20.0%, rgba(0,0,0,0.7) 80.0%, transparent 80%),url(" + x.url + ")");
});
const base = this.location.getBaseHrefFromDOM(); const base = this.location.getBaseHrefFromDOM();
if (base.length > 1) { if (base.length > 1) {
this.baseUrl = base; this.baseUrl = base;
} }
this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x); this.settingsService.getCustomization().subscribe(x => this.customizationSettings = x);
this.settingsService.getEmailNotificationSettings().subscribe(x => this.emailSettings = x); this.settingsService.getEmailSettingsEnabled().subscribe(x => this.emailSettingsEnabled = x);
} }
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (this.emailSettings && this.emailSettings.enabled) { if (this.emailSettingsEnabled) {
if (form.invalid) { if (form.invalid) {
this.notify.error("Validation", "Email address is required"); this.notify.error("Email address is required");
return; return;
} }
this.identityService.submitResetPassword(form.value.email).subscribe(x => { this.identityService.submitResetPassword(form.value.email).subscribe(x => {
@ -47,7 +51,7 @@ export class ResetPasswordComponent implements OnInit {
}); });
}); });
} else { } else {
this.notify.error("Not Setup", "Sorry but the administrator has not set up email notitfications!"); this.notify.error("Sorry but the administrator has not set up email notifications!");
return; return;
} }
} }

@ -38,7 +38,7 @@ export class TokenResetPasswordComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notify.error("Validation", "Email address is required"); this.notify.error("Email address is required");
return; return;
} }
const token = form.value as IResetPasswordToken; const token = form.value as IResetPasswordToken;
@ -48,7 +48,7 @@ export class TokenResetPasswordComponent implements OnInit {
this.router.navigate(["login"]); this.router.navigate(["login"]);
} else { } else {
x.errors.forEach((val) => { x.errors.forEach((val) => {
this.notify.error("Error", val); this.notify.error(val);
}); });
} }
}); });

@ -9,15 +9,15 @@
<div class="col-md-1 col-md-push-9" *ngIf="isAdmin"> <div class="col-md-1 col-md-push-9" *ngIf="isAdmin">
<form>
<button style="text-align: right" *ngIf="child.canApprove && !child.approved" (click)="approve(child)" class="btn btn-sm btn-success-outline" type="submit"><i class="fa fa-plus"></i> Approve</button> <button *ngIf="child.canApprove && !child.approved" (click)="approve(child)" class="btn btn-sm btn-success-outline" type="submit"><i class="fa fa-plus"></i> Approve</button>
</form> <button *ngIf="child.available" (click)="changeAvailability(child, false)" style="text-align: right" value="false" class="btn btn-sm btn-info-outline change"><i class="fa fa-minus"></i> Mark Unavailable</button>
<form *ngIf="!child.denied"> <button *ngIf="!child.available" (click)="changeAvailability(child, true)" style="text-align: right" value="true" class="btn btn-sm btn-success-outline change"><i class="fa fa-plus"></i> Mark Available</button>
<button type="button" (click)="deny(child)" class="btn btn-sm btn-danger-outline deny"><i class="fa fa-times"></i> Deny</button>
</form> <button *ngIf="!child.denied" type="button" (click)="deny(child)" class="btn btn-sm btn-danger-outline deny"><i class="fa fa-times"></i> Deny</button>
<form>
<button type="button" (click)="removeRequest(child)" class="btn btn-sm btn-danger-outline deny"><i class="fa fa-times"></i> Remove</button> <button type="button" (click)="removeRequest(child)" class="btn btn-sm btn-danger-outline deny"><i class="fa fa-times"></i> Remove</button>
</form>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">

@ -25,6 +25,11 @@ export class TvRequestChildrenComponent {
public changeAvailability(request: IChildRequests, available: boolean) { public changeAvailability(request: IChildRequests, available: boolean) {
request.available = available; request.available = available;
request.seasonRequests.forEach((season)=> {
season.episodes.forEach((ep)=> {
ep.available = available;
});
});
if(available) { if(available) {
this.requestService.markTvAvailable({ id: request.id }).subscribe(x => { this.requestService.markTvAvailable({ id: request.id }).subscribe(x => {
if (x.result) { if (x.result) {

@ -90,7 +90,7 @@ export class MovieSearchComponent implements OnInit {
searchResult.processed = false; searchResult.processed = false;
searchResult.requestProcessing = false; searchResult.requestProcessing = false;
this.notificationService.error("Something went wrong", e); this.notificationService.error(e);
} }
} }

@ -91,7 +91,7 @@ export class MovieSearchGridComponent implements OnInit {
searchResult.processed = false; searchResult.processed = false;
searchResult.requestProcessing = false; searchResult.requestProcessing = false;
this.notificationService.error("Something went wrong", e); this.notificationService.error(e);
} }
} }

@ -22,8 +22,8 @@ export class NotificationService {
this.addMessage({ severity: "warning", detail: body, summary: title }); this.addMessage({ severity: "warning", detail: body, summary: title });
} }
public error(title: string, body: string) { public error(body: string) {
this.addMessage({ severity: "error", detail: body, summary: title }); this.addMessage({ severity: "error", detail: body });
} }
public clearMessages() { public clearMessages() {

@ -124,6 +124,9 @@ export class SettingsService extends ServiceAuthHelpers {
public getEmailNotificationSettings(): Observable<IEmailNotificationSettings> { public getEmailNotificationSettings(): Observable<IEmailNotificationSettings> {
return this.httpAuth.get(`${this.url}/notifications/email`).map(this.extractData).catch(this.handleError); return this.httpAuth.get(`${this.url}/notifications/email`).map(this.extractData).catch(this.handleError);
} }
public getEmailSettingsEnabled(): Observable<boolean> {
return this.nonAuthHttp.get(`${this.url}/notifications/email/enabled`).map(this.extractData).catch(this.handleError);
}
public saveEmailNotificationSettings(settings: IEmailNotificationSettings): Observable<boolean> { public saveEmailNotificationSettings(settings: IEmailNotificationSettings): Observable<boolean> {
return this.httpAuth return this.httpAuth

@ -51,7 +51,7 @@ export class CouchPotatoComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
@ -68,7 +68,7 @@ export class CouchPotatoComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
const settings = form.value; const settings = form.value;
@ -76,7 +76,7 @@ export class CouchPotatoComponent implements OnInit {
if (x === true) { if (x === true) {
this.notificationService.success("Connected", "Successfully connected to CouchPotato!"); this.notificationService.success("Connected", "Successfully connected to CouchPotato!");
} else { } else {
this.notificationService.error("Connected", "We could not connect to CouchPotato!"); this.notificationService.error("We could not connect to CouchPotato!");
} }
}); });
} }
@ -87,7 +87,7 @@ export class CouchPotatoComponent implements OnInit {
(<FormControl>this.form.controls.apiKey).setValue(x.api_key); (<FormControl>this.form.controls.apiKey).setValue(x.api_key);
this.notificationService.success("Api Key", "Successfully got the Api Key"); this.notificationService.success("Api Key", "Successfully got the Api Key");
} else { } else {
this.notificationService.error("Api Key", "Could not get the Api Key"); this.notificationService.error("Could not get the Api Key");
} }
}); });
} }

@ -29,7 +29,7 @@ export class DogNzbComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -41,7 +41,7 @@ export class EmbyComponent implements OnInit {
if (x === true) { if (x === true) {
this.notificationService.success("Connected", `Successfully connected to the Emby server ${server.name}!`); this.notificationService.success("Connected", `Successfully connected to the Emby server ${server.name}!`);
} else { } else {
this.notificationService.error("Connected", `We could not connect to the Emby server ${server.name}!`); this.notificationService.error(`We could not connect to the Emby server ${server.name}!`);
} }
}); });
} }

@ -35,7 +35,7 @@ export class DiscordComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
@ -54,7 +54,7 @@ export class DiscordComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -50,7 +50,7 @@ export class EmailNotificationComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
@ -69,7 +69,7 @@ export class EmailNotificationComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -37,7 +37,7 @@ export class MattermostComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
@ -56,7 +56,7 @@ export class MattermostComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -33,7 +33,7 @@ export class PushbulletComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
@ -52,7 +52,7 @@ export class PushbulletComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -33,7 +33,7 @@ export class PushoverComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
@ -52,7 +52,7 @@ export class PushoverComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -37,14 +37,14 @@ export class SlackComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
const settings = <ISlackNotificationSettings>form.value; const settings = <ISlackNotificationSettings>form.value;
if (settings.iconEmoji && settings.iconUrl) { if (settings.iconEmoji && settings.iconUrl) {
this.notificationService.error("Validation", "You cannot have a Emoji icon and a URL icon"); this.notificationService.error("You cannot have a Emoji icon and a URL icon");
return; return;
} }
settings.notificationTemplates = this.templates; settings.notificationTemplates = this.templates;
@ -61,14 +61,14 @@ export class SlackComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
const settings = <ISlackNotificationSettings>form.value; const settings = <ISlackNotificationSettings>form.value;
if (settings.iconEmoji && settings.iconUrl) { if (settings.iconEmoji && settings.iconUrl) {
this.notificationService.error("Validation", "You cannot have a Emoji icon and a URL icon"); this.notificationService.error("You cannot have a Emoji icon and a URL icon");
return; return;
} }
this.testerService.slackTest(settings).subscribe(x => { this.testerService.slackTest(settings).subscribe(x => {

@ -34,7 +34,7 @@ export class OmbiComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -63,7 +63,7 @@ export class PlexComponent implements OnInit, OnDestroy {
if (x === true) { if (x === true) {
this.notificationService.success("Connected", `Successfully connected to the Plex server ${server.name}!`); this.notificationService.success("Connected", `Successfully connected to the Plex server ${server.name}!`);
} else { } else {
this.notificationService.error("Connected", `We could not connect to the Plex server ${server.name}!`); this.notificationService.error(`We could not connect to the Plex server ${server.name}!`);
} }
}); });
} }
@ -85,7 +85,7 @@ export class PlexComponent implements OnInit, OnDestroy {
public loadLibraries(server: IPlexServer) { public loadLibraries(server: IPlexServer) {
if (server.ip == null) { if (server.ip == null) {
this.notificationService.error("Not Configured", "Plex is not yet configured correctly"); this.notificationService.error("Plex is not yet configured correctly");
return; return;
} }
this.plexService.getLibraries(server).subscribe(x => { this.plexService.getLibraries(server).subscribe(x => {
@ -100,10 +100,10 @@ export class PlexComponent implements OnInit, OnDestroy {
server.plexSelectedLibraries.push(lib); server.plexSelectedLibraries.push(lib);
}); });
} else { } else {
this.notificationService.error("Error", x.message); this.notificationService.error(x.message);
} }
}, },
err => { this.notificationService.error("Error", err); }); err => { this.notificationService.error(err); });
} }
public save() { public save() {

@ -88,7 +88,7 @@ export class RadarrComponent implements OnInit {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
const settings = <IRadarrSettings>form.value; const settings = <IRadarrSettings>form.value;
@ -96,14 +96,14 @@ export class RadarrComponent implements OnInit {
if (x === true) { if (x === true) {
this.notificationService.success("Connected", "Successfully connected to Radarr!"); this.notificationService.success("Connected", "Successfully connected to Radarr!");
} else { } else {
this.notificationService.error("Connected", "We could not connect to Radarr!"); this.notificationService.error("We could not connect to Radarr!");
} }
}); });
} }
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }

@ -87,7 +87,7 @@ export class SonarrComponent implements OnInit, OnDestroy {
public test(form: FormGroup) { public test(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
const settings = <ISonarrSettings>form.value; const settings = <ISonarrSettings>form.value;
@ -95,14 +95,14 @@ export class SonarrComponent implements OnInit, OnDestroy {
if (x) { if (x) {
this.notificationService.success("Connected", "Successfully connected to Sonarr!"); this.notificationService.success("Connected", "Successfully connected to Sonarr!");
} else { } else {
this.notificationService.error("Connected", "We could not connect to Sonarr!"); this.notificationService.error("We could not connect to Sonarr!");
} }
}); });
} }
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
this.settingsService.saveSonarr(form.value) this.settingsService.saveSonarr(form.value)
@ -111,7 +111,7 @@ export class SonarrComponent implements OnInit, OnDestroy {
if (x) { if (x) {
this.notificationService.success("Settings Saved", "Successfully saved Sonarr settings"); this.notificationService.success("Settings Saved", "Successfully saved Sonarr settings");
} else { } else {
this.notificationService.error("Settings Saved", "There was an error when saving the Sonarr settings"); this.notificationService.error("There was an error when saving the Sonarr settings");
} }
}); });
} }

@ -56,7 +56,7 @@ export class UpdateComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
this.enableUpdateButton = form.value.autoUpdateEnabled; this.enableUpdateButton = form.value.autoUpdateEnabled;
@ -65,7 +65,7 @@ export class UpdateComponent implements OnInit {
if (x) { if (x) {
this.notificationService.success("Settings Saved", "Successfully saved Update settings"); this.notificationService.success("Settings Saved", "Successfully saved Update settings");
} else { } else {
this.notificationService.error("Settings Saved", "There was an error when saving the Update settings"); this.notificationService.error("There was an error when saving the Update settings");
} }
}); });
} }

@ -33,13 +33,13 @@ export class UpdateDetailsComponent implements OnInit {
public onSubmit(form: FormGroup) { public onSubmit(form: FormGroup) {
if (form.invalid) { if (form.invalid) {
this.notificationService.error("Validation", "Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
if (form.controls.password.dirty) { if (form.controls.password.dirty) {
if (form.value.password !== form.value.confirmNewPassword) { if (form.value.password !== form.value.confirmNewPassword) {
this.notificationService.error("Error", "Passwords do not match"); this.notificationService.error("Passwords do not match");
return; return;
} }
} }
@ -49,7 +49,7 @@ export class UpdateDetailsComponent implements OnInit {
this.notificationService.success("Updated", `All of your details have now been updated`); this.notificationService.success("Updated", `All of your details have now been updated`);
} else { } else {
x.errors.forEach((val) => { x.errors.forEach((val) => {
this.notificationService.error("Error", val); this.notificationService.error(val);
}); });
} }
}); });

@ -37,7 +37,7 @@ export class UserManagementAddComponent implements OnInit {
if (this.user.password) { if (this.user.password) {
if (this.user.password !== this.confirmPass) { if (this.user.password !== this.confirmPass) {
this.notificationSerivce.error("Error", "Passwords do not match"); this.notificationSerivce.error("Passwords do not match");
return; return;
} }
} }
@ -48,7 +48,7 @@ export class UserManagementAddComponent implements OnInit {
}); });
if (!hasClaims) { if (!hasClaims) {
this.notificationSerivce.error("Error", "Please assign a role"); this.notificationSerivce.error("Please assign a role");
return; return;
} }
@ -58,7 +58,7 @@ export class UserManagementAddComponent implements OnInit {
this.router.navigate(["usermanagement"]); this.router.navigate(["usermanagement"]);
} else { } else {
x.errors.forEach((val) => { x.errors.forEach((val) => {
this.notificationSerivce.error("Error", val); this.notificationSerivce.error(val);
}); });
} }
}); });

@ -42,7 +42,7 @@ export class UserManagementEditComponent {
this.router.navigate(["usermanagement"]); this.router.navigate(["usermanagement"]);
} else { } else {
x.errors.forEach((val) => { x.errors.forEach((val) => {
this.notificationService.error("Error", val); this.notificationService.error(val);
}); });
} }
@ -61,7 +61,7 @@ export class UserManagementEditComponent {
this.router.navigate(["usermanagement"]); this.router.navigate(["usermanagement"]);
} else { } else {
x.errors.forEach((val) => { x.errors.forEach((val) => {
this.notificationService.error("Error", val); this.notificationService.error(val);
}); });
} }
@ -76,7 +76,7 @@ export class UserManagementEditComponent {
}); });
if (!hasClaims) { if (!hasClaims) {
this.notificationService.error("Error", "Please assign a role"); this.notificationService.error("Please assign a role");
return; return;
} }
@ -86,7 +86,7 @@ export class UserManagementEditComponent {
this.router.navigate(["usermanagement"]); this.router.navigate(["usermanagement"]);
} else { } else {
x.errors.forEach((val) => { x.errors.forEach((val) => {
this.notificationService.error("Error", val); this.notificationService.error(val);
}); });
} }
}); });

@ -29,11 +29,11 @@ export class UserManagementComponent implements OnInit {
public welcomeEmail(user: IUser) { public welcomeEmail(user: IUser) {
if(!user.emailAddress) { if(!user.emailAddress) {
this.notificationService.error("Email", "The user needs an email address."); this.notificationService.error("The user needs an email address.");
return; return;
} }
if (!this.emailSettings.enabled) { if (!this.emailSettings.enabled) {
this.notificationService.error("Email", "Email Notifications are not setup, cannot send welcome email"); this.notificationService.error("Email Notifications are not setup, cannot send welcome email");
return; return;
} }
this.identityService.sendWelcomeEmail(user).subscribe(); this.identityService.sendWelcomeEmail(user).subscribe();

@ -38,8 +38,7 @@ export class CreateAdminComponent {
}); });
} else { } else {
this.notificationService.error("Error in creating user", this.notificationService.error("There was an error... You might want to put this on Github...");
"There was an error... You might want to put this on Github...");
} }
}); });
} }

@ -41,7 +41,7 @@ export class EmbyComponent implements OnInit {
public save() { public save() {
this.embyService.logIn(this.embySettings).subscribe(x => { this.embyService.logIn(this.embySettings).subscribe(x => {
if (x == null || !x.servers[0].apiKey) { if (x == null || !x.servers[0].apiKey) {
this.notificationService.error("Could Not Authenticate", "Username or password was incorrect. Could not authenticate with Emby."); this.notificationService.error("Username or password was incorrect. Could not authenticate with Emby.");
return; return;
} }
this.router.navigate(["Wizard/CreateAdmin"]); this.router.navigate(["Wizard/CreateAdmin"]);

@ -21,7 +21,7 @@ export class PlexComponent {
public requestAuthToken() { public requestAuthToken() {
this.plexService.logIn(this.login, this.password).subscribe(x => { this.plexService.logIn(this.login, this.password).subscribe(x => {
if (x.user == null) { if (x.user == null) {
this.notificationService.error("Could Not Authenticate", "Username or password was incorrect. Could not authenticate with Plex."); this.notificationService.error("Username or password was incorrect. Could not authenticate with Plex.");
return; return;
} }
this.authenticationResult = x; this.authenticationResult = x;

@ -828,4 +828,8 @@ a > h4:hover {
.btn-split .btn.dropdown-toggle { .btn-split .btn.dropdown-toggle {
border-radius: 0 0.25rem 0.25rem 0 !important; border-radius: 0 0.25rem 0.25rem 0 !important;
padding: 3.5px 10px; padding: 3.5px 10px;
} }
.ui-treetable tbody td {
padding: 0.25em 3.5em;
}

@ -407,6 +407,19 @@ namespace Ombi.Controllers
return model; return model;
} }
/// <summary>
/// Gets the Email Notification Settings.
/// </summary>
/// <returns></returns>
[HttpGet("notifications/email/enabled")]
[AllowAnonymous]
public async Task<bool> EmailNotificationSettingsEnabled()
{
var emailSettings = await Get<EmailNotificationSettings>();
return emailSettings.Enabled;
}
/// <summary> /// <summary>
/// Saves the discord notification settings. /// Saves the discord notification settings.
/// </summary> /// </summary>

@ -55,8 +55,7 @@ namespace Ombi
if (string.IsNullOrEmpty(StoragePath.StoragePath)) if (string.IsNullOrEmpty(StoragePath.StoragePath))
{ {
config = new LoggerConfiguration() config = new LoggerConfiguration()
.MinimumLevel.Information() .MinimumLevel.Debug()
.WriteTo.RollingFile(Path.Combine(env.ContentRootPath, "Logs", "log-{Date}.txt")) .WriteTo.RollingFile(Path.Combine(env.ContentRootPath, "Logs", "log-{Date}.txt"))
.WriteTo.SQLite("Ombi.db", "Logs", LogEventLevel.Debug) .WriteTo.SQLite("Ombi.db", "Logs", LogEventLevel.Debug)
.CreateLogger(); .CreateLogger();
@ -64,8 +63,7 @@ namespace Ombi
else else
{ {
config = new LoggerConfiguration() config = new LoggerConfiguration()
.MinimumLevel.Information() .MinimumLevel.Debug()
.WriteTo.RollingFile(Path.Combine(StoragePath.StoragePath, "Logs", "log-{Date}.txt")) .WriteTo.RollingFile(Path.Combine(StoragePath.StoragePath, "Logs", "log-{Date}.txt"))
.WriteTo.SQLite(Path.Combine(StoragePath.StoragePath, "Ombi.db"), "Logs", LogEventLevel.Debug) .WriteTo.SQLite(Path.Combine(StoragePath.StoragePath, "Ombi.db"), "Logs", LogEventLevel.Debug)
.CreateLogger(); .CreateLogger();

@ -4,10 +4,16 @@
"UsernamePlaceholder": "Username", "UsernamePlaceholder": "Username",
"PasswordPlaceholder": "Password", "PasswordPlaceholder": "Password",
"RememberMe": "Remember Me", "RememberMe": "Remember Me",
"ForgottenPassword": "Forgot your password?" "ForgottenPassword": "Forgot your password?",
"Errors":{
"IncorrectCredentials":"Incorrect username or password"
}
}, },
"Common":{ "Common":{
"ContinueButton":"Continue" "ContinueButton":"Continue",
"Errors":{
"Validation":"Please check your entered values"
}
}, },
"PasswordReset": { "PasswordReset": {
"EmailAddressPlaceholder": "Email Address", "EmailAddressPlaceholder": "Email Address",
@ -25,7 +31,7 @@
"OfflineHeading":"Currently Offline", "OfflineHeading":"Currently Offline",
"OfflineParagraph":"The media server is currently offline.", "OfflineParagraph":"The media server is currently offline.",
"CheckPageForUpdates":"Check this page for continous site updates." "CheckPageForUpdates":"Check this page for continuous site updates."
}, },
"NavigationBar":{ "NavigationBar":{
"Search":"Search", "Search":"Search",

Loading…
Cancel
Save