From 8123d3e9140d1d866b161b0d074234e72455a07b Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 3 May 2020 23:08:42 +0100 Subject: [PATCH] Removed the connectionstring from the settings, the request grid count also should stick per user now --- src/Ombi/ClientApp/src/app/interfaces/ISettings.ts | 3 --- .../components/movies-grid/movies-grid.component.ts | 7 +++++++ .../requests-list/components/tv-grid/tv-grid.component.ts | 6 ++++++ .../ClientApp/src/app/settings/about/about.component.html | 6 +++--- src/Ombi/Controllers/V1/SettingsController.cs | 3 --- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts index a4e49a754..78a6d5822 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/ISettings.ts @@ -196,9 +196,6 @@ export interface IAbout { ombiDatabaseType: string; externalDatabaseType: string; settingsDatabaseType: string; - ombiConnectionString: string; - externalConnectionString: string; - settingsConnectionString: string; storagePath: string; notSupported: boolean; } diff --git a/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.ts b/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.ts index 4443cd4ed..e31e7ed66 100644 --- a/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.ts +++ b/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.ts @@ -26,6 +26,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit { private storageKey = "Movie_DefaultRequestListSort"; private storageKeyOrder = "Movie_DefaultRequestListSortOrder"; + private storageKeyGridCount = "Movie_DefaultGridCount"; @Output() public onOpenOptions = new EventEmitter<{ request: any, filter: any, onChange: any }>(); @@ -38,6 +39,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit { } public ngOnInit() { + const defaultCount = this.storageService.get(this.storageKeyGridCount); const defaultSort = this.storageService.get(this.storageKey); const defaultOrder = this.storageService.get(this.storageKeyOrder); if (defaultSort) { @@ -46,6 +48,9 @@ export class MoviesGridComponent implements OnInit, AfterViewInit { if (defaultOrder) { this.defaultOrder = defaultOrder; } + if(defaultCount) { + this.gridCount = defaultCount; + } } public async ngAfterViewInit() { @@ -54,6 +59,8 @@ export class MoviesGridComponent implements OnInit, AfterViewInit { // this.dataSource = results.collection; // this.resultsLength = results.total; + this.storageService.save(this.storageKeyGridCount, this.gridCount); + this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser"); // If the user changes the sort order, reset back to the first page. diff --git a/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.ts b/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.ts index 3e13a5ce2..26322dc3c 100644 --- a/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.ts +++ b/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.ts @@ -26,6 +26,7 @@ export class TvGridComponent implements OnInit, AfterViewInit { private storageKey = "Tv_DefaultRequestListSort"; private storageKeyOrder = "Tv_DefaultRequestListSortOrder"; + private storageKeyGridCount = "Tv_DefaultGridCount"; @Output() public onOpenOptions = new EventEmitter<{request: any, filter: any, onChange: any}>(); @@ -38,6 +39,7 @@ export class TvGridComponent implements OnInit, AfterViewInit { } public ngOnInit() { + const defaultCount = this.storageService.get(this.storageKeyGridCount); const defaultSort = this.storageService.get(this.storageKey); const defaultOrder = this.storageService.get(this.storageKeyOrder); if (defaultSort) { @@ -46,10 +48,14 @@ export class TvGridComponent implements OnInit, AfterViewInit { if (defaultOrder) { this.defaultOrder = defaultOrder; } + if (defaultCount) { + this.gridCount = defaultCount; + } } public async ngAfterViewInit() { + this.storageService.save(this.storageKeyGridCount, this.gridCount); this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser"); // If the user changes the sort order, reset back to the first page. this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); diff --git a/src/Ombi/ClientApp/src/app/settings/about/about.component.html b/src/Ombi/ClientApp/src/app/settings/about/about.component.html index b82f3ea4d..642c6b254 100644 --- a/src/Ombi/ClientApp/src/app/settings/about/about.component.html +++ b/src/Ombi/ClientApp/src/app/settings/about/about.component.html @@ -77,17 +77,17 @@
Ombi Database
-
{{about.ombiDatabaseType}} - {{about.ombiConnectionString}}
+
{{about.ombiDatabaseType}}
External Database
-
{{about.externalDatabaseType}} - {{about.externalConnectionString}}
+
{{about.externalDatabaseType}}
Settings Database
-
{{about.settingsDatabaseType}} - {{about.settingsConnectionString}}
+
{{about.settingsDatabaseType}}
diff --git a/src/Ombi/Controllers/V1/SettingsController.cs b/src/Ombi/Controllers/V1/SettingsController.cs index 8a0e52018..ac25fd123 100644 --- a/src/Ombi/Controllers/V1/SettingsController.cs +++ b/src/Ombi/Controllers/V1/SettingsController.cs @@ -123,11 +123,8 @@ namespace Ombi.Controllers.V1 OsDescription = RuntimeInformation.OSDescription, ProcessArchitecture = RuntimeInformation.ProcessArchitecture.ToString(), ApplicationBasePath = Directory.GetCurrentDirectory(), - ExternalConnectionString = dbConfiguration.ExternalDatabase.ConnectionString, ExternalDatabaseType = dbConfiguration.ExternalDatabase.Type, - OmbiConnectionString = dbConfiguration.OmbiDatabase.ConnectionString, OmbiDatabaseType = dbConfiguration.OmbiDatabase.Type, - SettingsConnectionString = dbConfiguration.SettingsDatabase.ConnectionString, SettingsDatabaseType = dbConfiguration.SettingsDatabase.Type, StoragePath = storage.StoragePath.HasValue() ? storage.StoragePath : "None Specified", NotSupported = Directory.GetCurrentDirectory().Contains("qpkg")