diff --git a/src/Ombi.Core/Engine/TvRequestEngine.cs b/src/Ombi.Core/Engine/TvRequestEngine.cs index 4099069e0..a10387897 100644 --- a/src/Ombi.Core/Engine/TvRequestEngine.cs +++ b/src/Ombi.Core/Engine/TvRequestEngine.cs @@ -274,6 +274,13 @@ namespace Ombi.Core.Engine }; } request.Available = false; + foreach (var season in request.SeasonRequests) + { + foreach (var e in season.Episodes) + { + e.Available = false; + } + } await TvRepository.UpdateChild(request); NotificationHelper.Notify(request, NotificationType.RequestAvailable); return new RequestEngineResult @@ -285,7 +292,7 @@ namespace Ombi.Core.Engine public async Task 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) { return new RequestEngineResult @@ -294,6 +301,13 @@ namespace Ombi.Core.Engine }; } request.Available = true; + foreach (var season in request.SeasonRequests) + { + foreach (var e in season.Episodes) + { + e.Available = true; + } + } await TvRepository.UpdateChild(request); NotificationHelper.Notify(request, NotificationType.RequestAvailable); return new RequestEngineResult diff --git a/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs b/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs index 977a5c73d..6d5057bcf 100644 --- a/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs +++ b/src/Ombi.Schedule/Jobs/Ombi/OmbiAutomaticUpdater.cs @@ -19,6 +19,8 @@ using Ombi.Api.Service.Models; using Ombi.Core.Settings; using Ombi.Helpers; using Ombi.Settings.Settings.Models; +using Ombi.Store.Entities; +using Ombi.Store.Repository; using Ombi.Updater; using SharpCompress.Readers; using SharpCompress.Readers.Tar; @@ -28,12 +30,13 @@ namespace Ombi.Schedule.Jobs.Ombi public class OmbiAutomaticUpdater : IOmbiAutomaticUpdater { public OmbiAutomaticUpdater(ILogger log, IOmbiService service, - ISettingsService s, IProcessProvider proc) + ISettingsService s, IProcessProvider proc, IRepository appConfig) { Logger = log; OmbiService = service; Settings = s; _processProvider = proc; + _appConfig = appConfig; } private ILogger Logger { get; } @@ -41,6 +44,7 @@ namespace Ombi.Schedule.Jobs.Ombi private ISettingsService Settings { get; } private readonly IProcessProvider _processProvider; private static PerformContext Ctx { get; set; } + private readonly IRepository _appConfig; public string[] GetVersion() { @@ -182,13 +186,15 @@ namespace Ombi.Schedule.Jobs.Ombi } var updaterFile = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "TempUpdate", $"Ombi.Updater{updaterExtension}"); + + // There must be an update var start = new ProcessStartInfo { UseShellExecute = false, CreateNoWindow = true, 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"), }; 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) { var scriptToRun = settings.ScriptLocation; @@ -230,7 +248,7 @@ namespace Ombi.Schedule.Jobs.Ombi var ombiProcess = _processProvider.FindProcessByName(settings.ProcessName).FirstOrDefault(); 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"); } diff --git a/src/Ombi.Updater/Installer.cs b/src/Ombi.Updater/Installer.cs index dbf6943e7..794aca1c7 100644 --- a/src/Ombi.Updater/Installer.cs +++ b/src/Ombi.Updater/Installer.cs @@ -56,7 +56,8 @@ namespace Ombi.Updater { UseShellExecute = false, FileName = Path.Combine(options.ApplicationPath,fileName), - WorkingDirectory = options.ApplicationPath + WorkingDirectory = options.ApplicationPath, + Arguments = options.StartupArgs }; using (var proc = new Process { StartInfo = start }) { diff --git a/src/Ombi.Updater/Program.cs b/src/Ombi.Updater/Program.cs index 3f09c62cd..8f490a766 100644 --- a/src/Ombi.Updater/Program.cs +++ b/src/Ombi.Updater/Program.cs @@ -72,6 +72,14 @@ namespace Ombi.Updater ApplicationPath = args[0], 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 ombiProc = p.FindProcessByName(startup.ProcessName).FirstOrDefault(); @@ -87,5 +95,6 @@ namespace Ombi.Updater public string ProcessName { get; set; } public string ApplicationPath { get; set; } public int OmbiProcessId { get; set; } + public string StartupArgs { get; set; } } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/app.component.html b/src/Ombi/ClientApp/app/app.component.html index 921f68b81..dd9402ac3 100644 --- a/src/Ombi/ClientApp/app/app.component.html +++ b/src/Ombi/ClientApp/app/app.component.html @@ -72,7 +72,7 @@
  • - {{ 'NavigationBar.UpdateDetails' | translate }} + {{ 'NavigationBar.Logout' | translate }}
  • diff --git a/src/Ombi/ClientApp/app/login/login.component.ts b/src/Ombi/ClientApp/app/login/login.component.ts index a71ea04ea..6a8d9e5bf 100644 --- a/src/Ombi/ClientApp/app/login/login.component.ts +++ b/src/Ombi/ClientApp/app/login/login.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from "@angular/core"; import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; +import { TranslateService } from "@ngx-translate/core"; import { PlatformLocation } from "@angular/common"; import { AuthService } from "../auth/auth.service"; @@ -23,10 +24,13 @@ export class LoginComponent implements OnInit { public background: any; public landingFlag: boolean; public baseUrl: string; + + private errorBody: string; + private errorValidation: string; 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 route: ActivatedRoute, private location: PlatformLocation) { + private route: ActivatedRoute, private location: PlatformLocation, private readonly translate: TranslateService) { this.route.params .subscribe((params: any) => { this.landingFlag = params.landing; @@ -61,11 +65,14 @@ export class LoginComponent implements OnInit { if (base.length > 1) { 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) { if (form.invalid) { - this.notify.error("Validation", "Please check your entered values"); + this.notify.error(this.errorValidation); return; } const value = form.value; @@ -76,9 +83,9 @@ export class LoginComponent implements OnInit { if (this.authService.loggedIn()) { this.router.navigate(["search"]); } 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)); } } diff --git a/src/Ombi/ClientApp/app/login/resetpassword.component.html b/src/Ombi/ClientApp/app/login/resetpassword.component.html index 9963d36a1..a902b56e4 100644 --- a/src/Ombi/ClientApp/app/login/resetpassword.component.html +++ b/src/Ombi/ClientApp/app/login/resetpassword.component.html @@ -2,7 +2,8 @@ you can substitue the span of reauth email for a input with the email and include the remember me checkbox --> -
    +
    +
    @@ -11,8 +12,8 @@ include the remember me checkbox

    diff --git a/src/Ombi/ClientApp/app/login/resetpassword.component.ts b/src/Ombi/ClientApp/app/login/resetpassword.component.ts index 5ce14463d..47ac2c139 100644 --- a/src/Ombi/ClientApp/app/login/resetpassword.component.ts +++ b/src/Ombi/ClientApp/app/login/resetpassword.component.ts @@ -1,11 +1,10 @@ import { PlatformLocation } from "@angular/common"; import { Component, OnInit } from "@angular/core"; import { FormBuilder, FormGroup, Validators } from "@angular/forms"; +import { DomSanitizer } from "@angular/platform-browser"; -import { ICustomizationSettings, IEmailNotificationSettings } from "../interfaces"; -import { IdentityService } from "../services"; -import { NotificationService } from "../services"; -import { SettingsService } from "../services"; +import { ICustomizationSettings } from "../interfaces"; +import { IdentityService, ImageService,NotificationService, SettingsService } from "../services"; @Component({ templateUrl: "./resetpassword.component.html", @@ -15,30 +14,35 @@ export class ResetPasswordComponent implements OnInit { public form: FormGroup; public customizationSettings: ICustomizationSettings; - public emailSettings: IEmailNotificationSettings; + public emailSettingsEnabled: boolean; public baseUrl: string; + public background: any; 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({ email: ["", [Validators.required]], }); } 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(); if (base.length > 1) { this.baseUrl = base; } 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) { - if (this.emailSettings && this.emailSettings.enabled) { + if (this.emailSettingsEnabled) { if (form.invalid) { - this.notify.error("Validation", "Email address is required"); + this.notify.error("Email address is required"); return; } this.identityService.submitResetPassword(form.value.email).subscribe(x => { @@ -47,7 +51,7 @@ export class ResetPasswordComponent implements OnInit { }); }); } 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; } } diff --git a/src/Ombi/ClientApp/app/login/tokenresetpassword.component.ts b/src/Ombi/ClientApp/app/login/tokenresetpassword.component.ts index 68714c795..85370c108 100644 --- a/src/Ombi/ClientApp/app/login/tokenresetpassword.component.ts +++ b/src/Ombi/ClientApp/app/login/tokenresetpassword.component.ts @@ -38,7 +38,7 @@ export class TokenResetPasswordComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notify.error("Validation", "Email address is required"); + this.notify.error("Email address is required"); return; } const token = form.value as IResetPasswordToken; @@ -48,7 +48,7 @@ export class TokenResetPasswordComponent implements OnInit { this.router.navigate(["login"]); } else { x.errors.forEach((val) => { - this.notify.error("Error", val); + this.notify.error(val); }); } }); diff --git a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html index 5066a5b78..3d6248fab 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html +++ b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.html @@ -9,15 +9,15 @@
    -
    - -
    -
    - -
    -
    + + + + + + + -
    +
    diff --git a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts index 789ca5854..6daa2dc7c 100644 --- a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts +++ b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts @@ -25,6 +25,11 @@ export class TvRequestChildrenComponent { public changeAvailability(request: IChildRequests, available: boolean) { request.available = available; + request.seasonRequests.forEach((season)=> { + season.episodes.forEach((ep)=> { + ep.available = available; + }); + }); if(available) { this.requestService.markTvAvailable({ id: request.id }).subscribe(x => { if (x.result) { diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.ts b/src/Ombi/ClientApp/app/search/moviesearch.component.ts index bc30cf56e..b470429a5 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.ts +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.ts @@ -90,7 +90,7 @@ export class MovieSearchComponent implements OnInit { searchResult.processed = false; searchResult.requestProcessing = false; - this.notificationService.error("Something went wrong", e); + this.notificationService.error(e); } } diff --git a/src/Ombi/ClientApp/app/search/moviesearchgrid.component.ts b/src/Ombi/ClientApp/app/search/moviesearchgrid.component.ts index b1b1789a3..839850f6f 100644 --- a/src/Ombi/ClientApp/app/search/moviesearchgrid.component.ts +++ b/src/Ombi/ClientApp/app/search/moviesearchgrid.component.ts @@ -91,7 +91,7 @@ export class MovieSearchGridComponent implements OnInit { searchResult.processed = false; searchResult.requestProcessing = false; - this.notificationService.error("Something went wrong", e); + this.notificationService.error(e); } } diff --git a/src/Ombi/ClientApp/app/services/notification.service.ts b/src/Ombi/ClientApp/app/services/notification.service.ts index 38ccf3091..eae0e20a0 100644 --- a/src/Ombi/ClientApp/app/services/notification.service.ts +++ b/src/Ombi/ClientApp/app/services/notification.service.ts @@ -22,8 +22,8 @@ export class NotificationService { this.addMessage({ severity: "warning", detail: body, summary: title }); } - public error(title: string, body: string) { - this.addMessage({ severity: "error", detail: body, summary: title }); + public error(body: string) { + this.addMessage({ severity: "error", detail: body }); } public clearMessages() { diff --git a/src/Ombi/ClientApp/app/services/settings.service.ts b/src/Ombi/ClientApp/app/services/settings.service.ts index 454ac7f48..9fb704c0c 100644 --- a/src/Ombi/ClientApp/app/services/settings.service.ts +++ b/src/Ombi/ClientApp/app/services/settings.service.ts @@ -124,6 +124,9 @@ export class SettingsService extends ServiceAuthHelpers { public getEmailNotificationSettings(): Observable { return this.httpAuth.get(`${this.url}/notifications/email`).map(this.extractData).catch(this.handleError); } + public getEmailSettingsEnabled(): Observable { + return this.nonAuthHttp.get(`${this.url}/notifications/email/enabled`).map(this.extractData).catch(this.handleError); + } public saveEmailNotificationSettings(settings: IEmailNotificationSettings): Observable { return this.httpAuth diff --git a/src/Ombi/ClientApp/app/settings/couchpotato/couchpotato.component.ts b/src/Ombi/ClientApp/app/settings/couchpotato/couchpotato.component.ts index 3edfa7f42..0421e0ec0 100644 --- a/src/Ombi/ClientApp/app/settings/couchpotato/couchpotato.component.ts +++ b/src/Ombi/ClientApp/app/settings/couchpotato/couchpotato.component.ts @@ -51,7 +51,7 @@ export class CouchPotatoComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } @@ -68,7 +68,7 @@ export class CouchPotatoComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } const settings = form.value; @@ -76,7 +76,7 @@ export class CouchPotatoComponent implements OnInit { if (x === true) { this.notificationService.success("Connected", "Successfully connected to CouchPotato!"); } 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 { (this.form.controls.apiKey).setValue(x.api_key); this.notificationService.success("Api Key", "Successfully got the Api Key"); } else { - this.notificationService.error("Api Key", "Could not get the Api Key"); + this.notificationService.error("Could not get the Api Key"); } }); } diff --git a/src/Ombi/ClientApp/app/settings/dognzb/dognzb.component.ts b/src/Ombi/ClientApp/app/settings/dognzb/dognzb.component.ts index 68cbcf16f..cb8e61e02 100644 --- a/src/Ombi/ClientApp/app/settings/dognzb/dognzb.component.ts +++ b/src/Ombi/ClientApp/app/settings/dognzb/dognzb.component.ts @@ -29,7 +29,7 @@ export class DogNzbComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/emby/emby.component.ts b/src/Ombi/ClientApp/app/settings/emby/emby.component.ts index 29b229831..015f82013 100644 --- a/src/Ombi/ClientApp/app/settings/emby/emby.component.ts +++ b/src/Ombi/ClientApp/app/settings/emby/emby.component.ts @@ -41,7 +41,7 @@ export class EmbyComponent implements OnInit { if (x === true) { this.notificationService.success("Connected", `Successfully connected to the Emby server ${server.name}!`); } 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}!`); } }); } diff --git a/src/Ombi/ClientApp/app/settings/notifications/discord.component.ts b/src/Ombi/ClientApp/app/settings/notifications/discord.component.ts index 766b2eebc..bfc48e06e 100644 --- a/src/Ombi/ClientApp/app/settings/notifications/discord.component.ts +++ b/src/Ombi/ClientApp/app/settings/notifications/discord.component.ts @@ -35,7 +35,7 @@ export class DiscordComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } @@ -54,7 +54,7 @@ export class DiscordComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/notifications/emailnotification.component.ts b/src/Ombi/ClientApp/app/settings/notifications/emailnotification.component.ts index 6e7d5a889..dba955f7f 100644 --- a/src/Ombi/ClientApp/app/settings/notifications/emailnotification.component.ts +++ b/src/Ombi/ClientApp/app/settings/notifications/emailnotification.component.ts @@ -50,7 +50,7 @@ export class EmailNotificationComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } @@ -69,7 +69,7 @@ export class EmailNotificationComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/notifications/mattermost.component.ts b/src/Ombi/ClientApp/app/settings/notifications/mattermost.component.ts index bc8b3ea38..bef5da618 100644 --- a/src/Ombi/ClientApp/app/settings/notifications/mattermost.component.ts +++ b/src/Ombi/ClientApp/app/settings/notifications/mattermost.component.ts @@ -37,7 +37,7 @@ export class MattermostComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } @@ -56,7 +56,7 @@ export class MattermostComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/notifications/pushbullet.component.ts b/src/Ombi/ClientApp/app/settings/notifications/pushbullet.component.ts index 894c3625d..2ac87c1b5 100644 --- a/src/Ombi/ClientApp/app/settings/notifications/pushbullet.component.ts +++ b/src/Ombi/ClientApp/app/settings/notifications/pushbullet.component.ts @@ -33,7 +33,7 @@ export class PushbulletComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } @@ -52,7 +52,7 @@ export class PushbulletComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/notifications/pushover.component.ts b/src/Ombi/ClientApp/app/settings/notifications/pushover.component.ts index 3fb5f9591..9ceefc9fe 100644 --- a/src/Ombi/ClientApp/app/settings/notifications/pushover.component.ts +++ b/src/Ombi/ClientApp/app/settings/notifications/pushover.component.ts @@ -33,7 +33,7 @@ export class PushoverComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } @@ -52,7 +52,7 @@ export class PushoverComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/notifications/slack.component.ts b/src/Ombi/ClientApp/app/settings/notifications/slack.component.ts index 6261da2bc..109768168 100644 --- a/src/Ombi/ClientApp/app/settings/notifications/slack.component.ts +++ b/src/Ombi/ClientApp/app/settings/notifications/slack.component.ts @@ -37,14 +37,14 @@ export class SlackComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } const settings = form.value; 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; } settings.notificationTemplates = this.templates; @@ -61,14 +61,14 @@ export class SlackComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } const settings = form.value; 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; } this.testerService.slackTest(settings).subscribe(x => { diff --git a/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts b/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts index c4ea3581c..9f5063339 100644 --- a/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts +++ b/src/Ombi/ClientApp/app/settings/ombi/ombi.component.ts @@ -34,7 +34,7 @@ export class OmbiComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/plex/plex.component.ts b/src/Ombi/ClientApp/app/settings/plex/plex.component.ts index c9dd370fe..c49f2cf6f 100644 --- a/src/Ombi/ClientApp/app/settings/plex/plex.component.ts +++ b/src/Ombi/ClientApp/app/settings/plex/plex.component.ts @@ -63,7 +63,7 @@ export class PlexComponent implements OnInit, OnDestroy { if (x === true) { this.notificationService.success("Connected", `Successfully connected to the Plex server ${server.name}!`); } 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) { 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; } this.plexService.getLibraries(server).subscribe(x => { @@ -100,10 +100,10 @@ export class PlexComponent implements OnInit, OnDestroy { server.plexSelectedLibraries.push(lib); }); } 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() { diff --git a/src/Ombi/ClientApp/app/settings/radarr/radarr.component.ts b/src/Ombi/ClientApp/app/settings/radarr/radarr.component.ts index 198b6e060..502e08a9f 100644 --- a/src/Ombi/ClientApp/app/settings/radarr/radarr.component.ts +++ b/src/Ombi/ClientApp/app/settings/radarr/radarr.component.ts @@ -88,7 +88,7 @@ export class RadarrComponent implements OnInit { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } const settings = form.value; @@ -96,14 +96,14 @@ export class RadarrComponent implements OnInit { if (x === true) { this.notificationService.success("Connected", "Successfully connected to Radarr!"); } else { - this.notificationService.error("Connected", "We could not connect to Radarr!"); + this.notificationService.error("We could not connect to Radarr!"); } }); } public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } diff --git a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts index ecb56f0c8..0bb8a98af 100644 --- a/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts +++ b/src/Ombi/ClientApp/app/settings/sonarr/sonarr.component.ts @@ -87,7 +87,7 @@ export class SonarrComponent implements OnInit, OnDestroy { public test(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } const settings = form.value; @@ -95,14 +95,14 @@ export class SonarrComponent implements OnInit, OnDestroy { if (x) { this.notificationService.success("Connected", "Successfully connected to Sonarr!"); } else { - this.notificationService.error("Connected", "We could not connect to Sonarr!"); + this.notificationService.error("We could not connect to Sonarr!"); } }); } public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } this.settingsService.saveSonarr(form.value) @@ -111,7 +111,7 @@ export class SonarrComponent implements OnInit, OnDestroy { if (x) { this.notificationService.success("Settings Saved", "Successfully saved Sonarr settings"); } 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"); } }); } diff --git a/src/Ombi/ClientApp/app/settings/update/update.component.ts b/src/Ombi/ClientApp/app/settings/update/update.component.ts index 6a3bd3891..cbc942c7d 100644 --- a/src/Ombi/ClientApp/app/settings/update/update.component.ts +++ b/src/Ombi/ClientApp/app/settings/update/update.component.ts @@ -56,7 +56,7 @@ export class UpdateComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } this.enableUpdateButton = form.value.autoUpdateEnabled; @@ -65,7 +65,7 @@ export class UpdateComponent implements OnInit { if (x) { this.notificationService.success("Settings Saved", "Successfully saved Update settings"); } 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"); } }); } diff --git a/src/Ombi/ClientApp/app/usermanagement/updatedetails.component.ts b/src/Ombi/ClientApp/app/usermanagement/updatedetails.component.ts index ef8d3b2a2..b899f036d 100644 --- a/src/Ombi/ClientApp/app/usermanagement/updatedetails.component.ts +++ b/src/Ombi/ClientApp/app/usermanagement/updatedetails.component.ts @@ -33,13 +33,13 @@ export class UpdateDetailsComponent implements OnInit { public onSubmit(form: FormGroup) { if (form.invalid) { - this.notificationService.error("Validation", "Please check your entered values"); + this.notificationService.error("Please check your entered values"); return; } if (form.controls.password.dirty) { if (form.value.password !== form.value.confirmNewPassword) { - this.notificationService.error("Error", "Passwords do not match"); + this.notificationService.error("Passwords do not match"); return; } } @@ -49,7 +49,7 @@ export class UpdateDetailsComponent implements OnInit { this.notificationService.success("Updated", `All of your details have now been updated`); } else { x.errors.forEach((val) => { - this.notificationService.error("Error", val); + this.notificationService.error(val); }); } }); diff --git a/src/Ombi/ClientApp/app/usermanagement/usermanagement-add.component.ts b/src/Ombi/ClientApp/app/usermanagement/usermanagement-add.component.ts index 6eab25736..43f74badb 100644 --- a/src/Ombi/ClientApp/app/usermanagement/usermanagement-add.component.ts +++ b/src/Ombi/ClientApp/app/usermanagement/usermanagement-add.component.ts @@ -37,7 +37,7 @@ export class UserManagementAddComponent implements OnInit { if (this.user.password) { if (this.user.password !== this.confirmPass) { - this.notificationSerivce.error("Error", "Passwords do not match"); + this.notificationSerivce.error("Passwords do not match"); return; } } @@ -48,7 +48,7 @@ export class UserManagementAddComponent implements OnInit { }); if (!hasClaims) { - this.notificationSerivce.error("Error", "Please assign a role"); + this.notificationSerivce.error("Please assign a role"); return; } @@ -58,7 +58,7 @@ export class UserManagementAddComponent implements OnInit { this.router.navigate(["usermanagement"]); } else { x.errors.forEach((val) => { - this.notificationSerivce.error("Error", val); + this.notificationSerivce.error(val); }); } }); diff --git a/src/Ombi/ClientApp/app/usermanagement/usermanagement-edit.component.ts b/src/Ombi/ClientApp/app/usermanagement/usermanagement-edit.component.ts index 6f1bf65ca..75196a98f 100644 --- a/src/Ombi/ClientApp/app/usermanagement/usermanagement-edit.component.ts +++ b/src/Ombi/ClientApp/app/usermanagement/usermanagement-edit.component.ts @@ -42,7 +42,7 @@ export class UserManagementEditComponent { this.router.navigate(["usermanagement"]); } else { x.errors.forEach((val) => { - this.notificationService.error("Error", val); + this.notificationService.error(val); }); } @@ -61,7 +61,7 @@ export class UserManagementEditComponent { this.router.navigate(["usermanagement"]); } else { x.errors.forEach((val) => { - this.notificationService.error("Error", val); + this.notificationService.error(val); }); } @@ -76,7 +76,7 @@ export class UserManagementEditComponent { }); if (!hasClaims) { - this.notificationService.error("Error", "Please assign a role"); + this.notificationService.error("Please assign a role"); return; } @@ -86,7 +86,7 @@ export class UserManagementEditComponent { this.router.navigate(["usermanagement"]); } else { x.errors.forEach((val) => { - this.notificationService.error("Error", val); + this.notificationService.error(val); }); } }); diff --git a/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts b/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts index c85be55e9..ccce2cb51 100644 --- a/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts +++ b/src/Ombi/ClientApp/app/usermanagement/usermanagement.component.ts @@ -29,11 +29,11 @@ export class UserManagementComponent implements OnInit { public welcomeEmail(user: IUser) { if(!user.emailAddress) { - this.notificationService.error("Email", "The user needs an email address."); + this.notificationService.error("The user needs an email address."); return; } 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; } this.identityService.sendWelcomeEmail(user).subscribe(); diff --git a/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts b/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts index 779d17f9c..759a8ff61 100644 --- a/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts +++ b/src/Ombi/ClientApp/app/wizard/createadmin/createadmin.component.ts @@ -38,8 +38,7 @@ export class CreateAdminComponent { }); } else { - this.notificationService.error("Error in creating user", - "There was an error... You might want to put this on Github..."); + this.notificationService.error("There was an error... You might want to put this on Github..."); } }); } diff --git a/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts b/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts index 3e74bfbca..1a41c649b 100644 --- a/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts +++ b/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts @@ -41,7 +41,7 @@ export class EmbyComponent implements OnInit { public save() { this.embyService.logIn(this.embySettings).subscribe(x => { 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; } this.router.navigate(["Wizard/CreateAdmin"]); diff --git a/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts b/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts index ba4740c22..db78f0889 100644 --- a/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts +++ b/src/Ombi/ClientApp/app/wizard/plex/plex.component.ts @@ -21,7 +21,7 @@ export class PlexComponent { public requestAuthToken() { this.plexService.logIn(this.login, this.password).subscribe(x => { 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; } this.authenticationResult = x; diff --git a/src/Ombi/ClientApp/styles/base.scss b/src/Ombi/ClientApp/styles/base.scss index d0813b6cb..1098b8319 100644 --- a/src/Ombi/ClientApp/styles/base.scss +++ b/src/Ombi/ClientApp/styles/base.scss @@ -828,4 +828,8 @@ a > h4:hover { .btn-split .btn.dropdown-toggle { border-radius: 0 0.25rem 0.25rem 0 !important; padding: 3.5px 10px; - } \ No newline at end of file + } + +.ui-treetable tbody td { + padding: 0.25em 3.5em; +} \ No newline at end of file diff --git a/src/Ombi/Controllers/SettingsController.cs b/src/Ombi/Controllers/SettingsController.cs index 94c35a4de..395a2b122 100644 --- a/src/Ombi/Controllers/SettingsController.cs +++ b/src/Ombi/Controllers/SettingsController.cs @@ -407,6 +407,19 @@ namespace Ombi.Controllers return model; } + + /// + /// Gets the Email Notification Settings. + /// + /// + [HttpGet("notifications/email/enabled")] + [AllowAnonymous] + public async Task EmailNotificationSettingsEnabled() + { + var emailSettings = await Get(); + return emailSettings.Enabled; + } + /// /// Saves the discord notification settings. /// diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index 8b66a07a2..2d1451433 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -55,8 +55,7 @@ namespace Ombi if (string.IsNullOrEmpty(StoragePath.StoragePath)) { config = new LoggerConfiguration() - .MinimumLevel.Information() - + .MinimumLevel.Debug() .WriteTo.RollingFile(Path.Combine(env.ContentRootPath, "Logs", "log-{Date}.txt")) .WriteTo.SQLite("Ombi.db", "Logs", LogEventLevel.Debug) .CreateLogger(); @@ -64,8 +63,7 @@ namespace Ombi else { config = new LoggerConfiguration() - .MinimumLevel.Information() - + .MinimumLevel.Debug() .WriteTo.RollingFile(Path.Combine(StoragePath.StoragePath, "Logs", "log-{Date}.txt")) .WriteTo.SQLite(Path.Combine(StoragePath.StoragePath, "Ombi.db"), "Logs", LogEventLevel.Debug) .CreateLogger(); diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 81e47616a..54e039f1a 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -4,10 +4,16 @@ "UsernamePlaceholder": "Username", "PasswordPlaceholder": "Password", "RememberMe": "Remember Me", - "ForgottenPassword": "Forgot your password?" + "ForgottenPassword": "Forgot your password?", + "Errors":{ + "IncorrectCredentials":"Incorrect username or password" + } }, "Common":{ - "ContinueButton":"Continue" + "ContinueButton":"Continue", + "Errors":{ + "Validation":"Please check your entered values" + } }, "PasswordReset": { "EmailAddressPlaceholder": "Email Address", @@ -25,7 +31,7 @@ "OfflineHeading":"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":{ "Search":"Search",