diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts index 6be02a4bc..371b17a49 100644 --- a/src/Ombi/ClientApp/src/app/app.module.ts +++ b/src/Ombi/ClientApp/src/app/app.module.ts @@ -84,7 +84,7 @@ const routes: Routes = [ // AoT requires an exported function for factories export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) { // const base = getBaseLocation(); - const base = platformLocation.getBaseHrefFromDOM(); + const base = window["baseHref"]; const version = Math.floor(Math.random() * 999999999); if (base !== null && base.length > 1) { return new TranslateHttpLoader(http, `${base}/translations/`, `.json?v=${version}`); diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html index 6882790f8..8abda7e21 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html @@ -82,9 +82,9 @@ [routerLink]="'/discover/collection/' + movie.belongsToCollection.id" mat-raised-button class="spacing-below full-width mat-elevation-z8">{{movie.belongsToCollection.name}} - + - + diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts index ae649fc3d..20dae078e 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts @@ -21,6 +21,7 @@ export class MovieDetailsComponent { public movieRequest: IMovieRequests; public isAdmin: boolean; public advancedOptions: IAdvancedData; + public showAdvanced: boolean; // Set on the UI private theMovidDbId: number; diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-admin-panel/movie-admin-panel.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-admin-panel/movie-admin-panel.component.ts index 8c3f378a7..ed7b54f97 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-admin-panel/movie-admin-panel.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-admin-panel/movie-admin-panel.component.ts @@ -13,6 +13,7 @@ export class MovieAdminPanelComponent implements OnInit { @Input() public movie: IMovieRequests; @Output() public advancedOptionsChanged = new EventEmitter(); + @Output() public radarrEnabledChange = new EventEmitter(); public radarrEnabled: boolean; public radarrProfiles: IRadarrProfile[]; @@ -34,6 +35,8 @@ export class MovieAdminPanelComponent implements OnInit { this.setRootFolderOverrides(); }); } + + this.radarrEnabledChange.emit(this.radarrEnabled); } public async openAdvancedOptions() { diff --git a/src/Ombi/ClientApp/src/app/services/signlarnotification.service.ts b/src/Ombi/ClientApp/src/app/services/signlarnotification.service.ts index ea4c4691c..72a101c86 100644 --- a/src/Ombi/ClientApp/src/app/services/signlarnotification.service.ts +++ b/src/Ombi/ClientApp/src/app/services/signlarnotification.service.ts @@ -3,27 +3,20 @@ import { AuthService } from '../auth/auth.service'; import { HubConnection } from '@aspnet/signalr'; import * as signalR from '@aspnet/signalr'; -import { PlatformLocation } from '@angular/common'; -import { platformBrowser } from '@angular/platform-browser'; - @Injectable() export class SignalRNotificationService { private hubConnection: HubConnection | undefined; public Notification: EventEmitter; - constructor(private authService: AuthService, private platform: PlatformLocation) { + constructor(private authService: AuthService) { this.Notification = new EventEmitter(); } public initialize(): void { this.stopConnection(); - let url = "/hubs/notification"; - const baseUrl = this.platform.getBaseHrefFromDOM(); - if(baseUrl !== null && baseUrl.length > 1) { - url = baseUrl + url; - } + let url = "hubs/notification"; this.hubConnection = new signalR.HubConnectionBuilder().withUrl(url, { accessTokenFactory: () => { return this.authService.getToken(); diff --git a/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts b/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts index cabe30426..e691ca627 100644 --- a/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/createadmin/createadmin.component.ts @@ -1,31 +1,16 @@ -import { Component, OnInit, Input } from "@angular/core"; -import { Router } from "@angular/router"; - -import { PlatformLocation } from "@angular/common"; -import { IdentityService } from "../../services"; -import { NotificationService } from "../../services"; +import { Component, Input } from "@angular/core"; import { ICreateWizardUser } from "../../interfaces"; @Component({ selector: "wizard-local-admin", templateUrl: "./createadmin.component.html", }) -export class CreateAdminComponent implements OnInit { +export class CreateAdminComponent { @Input() user: ICreateWizardUser; public username: string; - public password: string; - public baseUrl: string; - - - constructor(private location: PlatformLocation) { } - - public ngOnInit(): void { - const base = this.location.getBaseHrefFromDOM(); - if (base.length > 1) { - this.baseUrl = base; - } - } + public password: string; + constructor() { } } diff --git a/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts b/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts index dc9dfca70..5e8f1b2ef 100644 --- a/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/emby/emby.component.ts @@ -1,10 +1,8 @@ import { Component, OnInit } from "@angular/core"; -import { Router } from "@angular/router"; import { EmbyService } from "../../services"; import { NotificationService } from "../../services"; -import { PlatformLocation } from "@angular/common"; import { IEmbySettings } from "../../interfaces"; @Component({ @@ -14,19 +12,12 @@ import { IEmbySettings } from "../../interfaces"; export class EmbyComponent implements OnInit { public embySettings: IEmbySettings; - public baseUrl: string; constructor(private embyService: EmbyService, - private router: Router, - private notificationService: NotificationService, - private location: PlatformLocation) { + private notificationService: NotificationService) { } public ngOnInit() { - const base = this.location.getBaseHrefFromDOM(); - if (base.length > 1) { - this.baseUrl = base; - } this.embySettings = { servers: [], isJellyfin: false, diff --git a/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts b/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts index 1ea7615f3..e469ddc00 100644 --- a/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/plex/plex.component.ts @@ -1,7 +1,6 @@ import { Component, OnDestroy, OnInit } from "@angular/core"; import { Router } from "@angular/router"; -import { PlatformLocation } from "@angular/common"; import { AuthService } from "../../auth/auth.service"; import { PlexOAuthService, PlexService, PlexTvService, SettingsService } from "../../services"; import { IdentityService, NotificationService } from "../../services"; @@ -15,7 +14,6 @@ export class PlexComponent implements OnInit, OnDestroy { public login: string; public password: string; - public baseUrl: string; public pinTimer: any; private clientId: string; @@ -24,14 +22,10 @@ export class PlexComponent implements OnInit, OnDestroy { private notificationService: NotificationService, private identityService: IdentityService, private plexTv: PlexTvService, private settingsService: SettingsService, - private location: PlatformLocation, private authService: AuthService, + private authService: AuthService, private plexOauth: PlexOAuthService, private store: StorageService) { } public ngOnInit(): void { - const base = this.location.getBaseHrefFromDOM(); - if (base.length > 1) { - this.baseUrl = base; - } this.settingsService.getClientId().subscribe(x => this.clientId = x); } diff --git a/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts b/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts index 805264f96..a46b04bd4 100644 --- a/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts +++ b/src/Ombi/ClientApp/src/app/wizard/welcome/welcome.component.ts @@ -1,5 +1,4 @@ -import { PlatformLocation } from "@angular/common"; -import { Component, OnInit } from "@angular/core"; +import { Component, OnInit } from "@angular/core"; import { Router } from "@angular/router"; import { ICreateWizardUser } from "../../interfaces"; import { IdentityService, NotificationService } from "../../services"; @@ -9,10 +8,9 @@ import { IdentityService, NotificationService } from "../../services"; }) export class WelcomeComponent implements OnInit { - public baseUrl: string; public localUser: ICreateWizardUser; - constructor(private router: Router, private location: PlatformLocation, + constructor(private router: Router, private identityService: IdentityService, private notificationService: NotificationService) { } public ngOnInit(): void { @@ -21,10 +19,6 @@ export class WelcomeComponent implements OnInit { username:"", usePlexAdminAccount:false } - const base = this.location.getBaseHrefFromDOM(); - if (base.length > 1) { - this.baseUrl = base; - } } public createUser() { diff --git a/src/Ombi/ClientApp/src/index.html b/src/Ombi/ClientApp/src/index.html index ffa026566..32f0b4c9a 100644 --- a/src/Ombi/ClientApp/src/index.html +++ b/src/Ombi/ClientApp/src/index.html @@ -2,23 +2,46 @@ - - - - - + + + + diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index a691bc9af..9bb5ef629 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -27,6 +27,7 @@ using Serilog; using SQLitePCL; using System; using System.IO; +using Microsoft.AspNetCore.StaticFiles.Infrastructure; using Microsoft.Extensions.Hosting; using Newtonsoft.Json; using ILogger = Serilog.ILogger; @@ -120,12 +121,19 @@ namespace Ombi var ctx = serviceProvider.GetService(); loggerFactory.AddSerilog(); - - app.UseSpaStaticFiles(); - var ombiService = serviceProvider.GetService>(); var settings = ombiService.GetSettings(); + + var sharedOptions = new SharedOptions(); + if (settings.BaseUrl.HasValue()) + { + sharedOptions.RequestPath = settings.BaseUrl; + } + + app.UseSpaStaticFiles(new StaticFileOptions(sharedOptions)); + + if (settings.ApiKey.IsNullOrEmpty()) { // Generate a API Key @@ -159,20 +167,20 @@ namespace Ombi app.UsePathBase(settings.BaseUrl); } - // Setup the scheduler + // Setup the scheduler //var jobSetup = app.ApplicationServices.GetService(); //jobSetup.Setup(); ctx.Seed(); var settingsctx = serviceProvider.GetService(); settingsctx.Seed(); - var provider = new FileExtensionContentTypeProvider {Mappings = {[".map"] = "application/octet-stream"}}; + var provider = new FileExtensionContentTypeProvider { Mappings = { [".map"] = "application/octet-stream" } }; app.UseStaticFiles(new StaticFileOptions() { ContentTypeProvider = provider, }); - + app.UseMiddleware(); app.UseMiddleware(); app.UseRouting(); @@ -210,7 +218,7 @@ namespace Ombi spa.UseProxyToSpaDevelopmentServer("http://localhost:3578"); } }); - + } } }