diff --git a/.azuredevops/pipelines/publish-job.yml b/.azuredevops/pipelines/publish-job.yml index f7f2d4605..78697830b 100644 --- a/.azuredevops/pipelines/publish-job.yml +++ b/.azuredevops/pipelines/publish-job.yml @@ -111,7 +111,8 @@ stages: $header = @{ "Accept"="application/vnd.github.v3+json" - "Authorization"="Bearer ${env:APTPAT}" + "Authorization"="Bearer $(APTPAT)" + "User-Agent"="Ombi" } Invoke-RestMethod -Uri "https://api.github.com/repos/Ombi-app/Ombi.Apt/actions/workflows/build-deb.yml/dispatches" -Method 'Post' -Body $body -Headers $header \ No newline at end of file diff --git a/src/Ombi.Core/Engine/UserDeletionEngine.cs b/src/Ombi.Core/Engine/UserDeletionEngine.cs index 6ea1e794d..7df394592 100644 --- a/src/Ombi.Core/Engine/UserDeletionEngine.cs +++ b/src/Ombi.Core/Engine/UserDeletionEngine.cs @@ -5,6 +5,7 @@ using Ombi.Store.Entities; using Ombi.Store.Entities.Requests; using Ombi.Store.Repository; using Ombi.Store.Repository.Requests; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -93,18 +94,27 @@ namespace Ombi.Core.Engine var issues = _issuesRepository.GetAll().Where(x => x.UserReportedId == userId); var issueComments = _issueCommentsRepository.GetAll().Where(x => x.UserId == userId); var requestLog = _requestLogRepository.GetAll().Where(x => x.UserId == userId); + + if (issueComments.Any()) + { + await _issueCommentsRepository.DeleteRange(issueComments); + } if (issues.Any()) { + var extraComments = new List(); + var issueIds = issues.Select(x => x.Id).Distinct(); + foreach (var issue in issueIds) + { + // Get all the comments for this issue and delete them, since the issue will be deleted + var extra = _issueCommentsRepository.GetAll().Where(x => x.IssuesId == issue); + extraComments.AddRange(extra.ToList()); + } await _issuesRepository.DeleteRange(issues); } if (requestLog.Any()) { await _requestLogRepository.DeleteRange(requestLog); } - if (issueComments.Any()) - { - await _issueCommentsRepository.DeleteRange(issueComments); - } // Delete the Subscriptions and mobile notification ids var subs = _requestSubscriptionRepository.GetAll().Where(x => x.UserId == userId); diff --git a/src/Ombi.Core/Models/UI/UserViewModel.cs b/src/Ombi.Core/Models/UI/UserViewModel.cs index 0c9be846a..7ce2f7e7c 100644 --- a/src/Ombi.Core/Models/UI/UserViewModel.cs +++ b/src/Ombi.Core/Models/UI/UserViewModel.cs @@ -36,5 +36,7 @@ namespace Ombi.Core.Models.UI { public string Id { get; set; } public string Username { get; set; } + public string Email { get; set; } + } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/angular.json b/src/Ombi/ClientApp/angular.json index 2e3ff44e5..41030a25a 100644 --- a/src/Ombi/ClientApp/angular.json +++ b/src/Ombi/ClientApp/angular.json @@ -124,5 +124,8 @@ } } }, - "defaultProject": "ombi" + "defaultProject": "ombi", + "cli": { + "analytics": false + } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/app.component.ts b/src/Ombi/ClientApp/src/app/app.component.ts index 40ece5d31..edc20610d 100644 --- a/src/Ombi/ClientApp/src/app/app.component.ts +++ b/src/Ombi/ClientApp/src/app/app.component.ts @@ -10,7 +10,6 @@ import { SettingsService } from "./services"; import { MatSnackBar } from '@angular/material/snack-bar'; import { ICustomizationSettings, ICustomPage } from "./interfaces"; -import { StorageService } from './shared/storage/storage-service'; import { SignalRNotificationService } from './services/signlarnotification.service'; import { DOCUMENT } from '@angular/common'; @@ -46,7 +45,6 @@ export class AppComponent implements OnInit { public readonly translate: TranslateService, private readonly customPageService: CustomPageService, public overlayContainer: OverlayContainer, - private storage: StorageService, private signalrNotification: SignalRNotificationService, private readonly snackBar: MatSnackBar, private readonly identity: IdentityService, diff --git a/src/Ombi/ClientApp/src/app/interfaces/IUser.ts b/src/Ombi/ClientApp/src/app/interfaces/IUser.ts index 856d57f0a..148c5791b 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/IUser.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/IUser.ts @@ -28,6 +28,7 @@ export interface IUser { export interface IUserDropdown { username: string; id: string; + email: string; } export interface IUserQualityProfiles { diff --git a/src/Ombi/ClientApp/src/app/login/login.component.html b/src/Ombi/ClientApp/src/app/login/login.component.html index b0f4841fa..0769a185f 100644 --- a/src/Ombi/ClientApp/src/app/login/login.component.html +++ b/src/Ombi/ClientApp/src/app/login/login.component.html @@ -6,7 +6,8 @@
\ No newline at end of file + + diff --git a/src/Ombi/ClientApp/src/app/media-details/components/shared/request-behalf/request-behalf.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/shared/request-behalf/request-behalf.component.ts index da684db06..454ad3ee4 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/shared/request-behalf/request-behalf.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/shared/request-behalf/request-behalf.component.ts @@ -41,7 +41,9 @@ export class RequestBehalfComponent implements OnInit { } public displayFn(user: IUserDropdown): string { - return user?.username ? user.username : ''; + const username = user?.username ? user.username : ''; + const email = user?.email ? `(${user.email})` : ''; + return `${username} ${email}`; } private _filter(value: string|IUserDropdown): IUserDropdown[] { diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html index 777f4820e..2997cda3c 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html @@ -1,63 +1,68 @@ -
- - {{tv.rating}}/10 - - - {{ratings.score}}% - - -
+
+
+
+ + {{tv.rating}}/10 + + + {{ratings.score}}% + +
+
+
+
+ {{'MediaDetails.StreamingOn' | translate }}: +
+ + + +
+
+

- {{'MediaDetails.StreamingOn' | translate }}: +
+ {{'MediaDetails.Status' | translate }}: + {{tv.status}} +
+ First Aired: + {{tv.firstAired | date: 'mediumDate'}} +
+ +
+ Seasons: + {{seasonCount}} +
+
+ Episodes: + {{totalEpisodes}} +
+ +
+ {{'MediaDetails.RootFolderOverride' | translate }}: +
{{request.rootPathOverrideTitle}}
+
+
+ {{'MediaDetails.QualityOverride' | translate }}: +
{{request.qualityOverrideTitle}}
+
+ +
+ {{'MediaDetails.Runtime' | translate }}: + {{'MediaDetails.Minutes' | translate:{ runtime: tv.runtime} }} +
+ +
+ Network: + {{tv.network.name}} +
+ +
+ {{'MediaDetails.Genres' | translate }}:
- - - + + {{genre}} | +
-
-
- {{'MediaDetails.Status' | translate }}: - {{tv.status}} -
- First Aired: - {{tv.firstAired | date: 'mediumDate'}} -
- -
- Seasons: - {{seasonCount}} -
-
- Episodes: - {{totalEpisodes}} -
- -
- {{'MediaDetails.RootFolderOverride' | translate }}: -
{{request.rootPathOverrideTitle}}
-
-
- {{'MediaDetails.QualityOverride' | translate }}: -
{{request.qualityOverrideTitle}}
-
- -
- {{'MediaDetails.Runtime' | translate }}: - {{'MediaDetails.Minutes' | translate:{ runtime: tv.runtime} }} -
- -
- Network: - {{tv.network.name}} -
- -
- {{'MediaDetails.Genres' | translate }}: -
- - {{genre}} | - -
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html index 976fcfefc..7da2ee6ca 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html @@ -57,7 +57,7 @@ class="btn-spacing" color="accent" [disabled]> {{'Common.PartiallyAvailable' | translate }} - @@ -67,8 +67,8 @@
- - + + diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts index a5f80d2cf..b88678110 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts @@ -1,5 +1,5 @@ import { Component, ViewEncapsulation, OnInit } from "@angular/core"; -import { ImageService, SearchV2Service, MessageService, RequestService, SonarrService } from "../../../services"; +import { ImageService, SearchV2Service, MessageService, RequestService, SonarrService, SettingsStateService } from "../../../services"; import { ActivatedRoute } from "@angular/router"; import { DomSanitizer } from "@angular/platform-browser"; import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; @@ -29,6 +29,7 @@ export class TvDetailsComponent implements OnInit { public advancedOptions: IAdvancedData; public showAdvanced: boolean; // Set on the UI public requestType = RequestType.tvShow; + public issuesEnabled: boolean; private tvdbId: number; @@ -36,7 +37,7 @@ export class TvDetailsComponent implements OnInit { private sanitizer: DomSanitizer, private imageService: ImageService, public dialog: MatDialog, public messageService: MessageService, private requestService: RequestService, private requestService2: RequestServiceV2, - private auth: AuthService, private sonarrService: SonarrService) { + private auth: AuthService, private sonarrService: SonarrService, private settingsState: SettingsStateService) { this.route.params.subscribe((params: any) => { this.tvdbId = params.tvdbId; this.fromSearch = params.search; @@ -49,6 +50,7 @@ export class TvDetailsComponent implements OnInit { public async load() { + this.issuesEnabled = this.settingsState.getIssue(); this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser"); if (this.isAdmin) { diff --git a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss index 037d9bd23..13886c0db 100644 --- a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss +++ b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss @@ -288,6 +288,18 @@ font-weight:500; } +.left-panel-details .streaming-on-content{ + display:flex; + justify-content: center; + align-items: center; + flex-flow:row wrap; +} + +.left-panel-details .streaming-on-content .label{ + white-space:nowrap; + padding-right:10px; +} + .left-panel-details{ font-weight:100; } @@ -314,6 +326,7 @@ padding:2px 1.5em;; width:170px; margin-top:10px; + margin-left:10px; } @media (max-width:500px){ @@ -330,6 +343,7 @@ .media-row .mat-raised-button{ width:100%; + margin-left:0px; } .media-row .btn-spacing{ diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts index d7216d114..0ab4dc07e 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.ts @@ -4,7 +4,7 @@ import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { INavBar } from '../interfaces/ICommon'; import { StorageService } from '../shared/storage/storage-service'; -import { SettingsService } from '../services'; +import { SettingsService, SettingsStateService } from '../services'; import { MatSlideToggleChange } from '@angular/material/slide-toggle'; import { SearchFilter } from './SearchFilter'; import { Md5 } from 'ts-md5/dist/md5'; @@ -49,7 +49,8 @@ export class MyNavComponent implements OnInit { constructor(private breakpointObserver: BreakpointObserver, private settingsService: SettingsService, private store: StorageService, - private filterService: FilterService) { + private filterService: FilterService, + private readonly settingState: SettingsStateService) { } public async ngOnInit() { @@ -68,6 +69,8 @@ export class MyNavComponent implements OnInit { } this.issuesEnabled = await this.settingsService.issueEnabled().toPromise(); + this.settingState.setIssue(this.issuesEnabled); + const customizationSettings = await this.settingsService.getCustomization().toPromise(); console.log("issues enabled: " + this.issuesEnabled); this.theme = this.store.get("theme"); diff --git a/src/Ombi/ClientApp/src/app/services/filedownload.service.ts b/src/Ombi/ClientApp/src/app/services/filedownload.service.ts index a87f3b178..59cc00def 100644 --- a/src/Ombi/ClientApp/src/app/services/filedownload.service.ts +++ b/src/Ombi/ClientApp/src/app/services/filedownload.service.ts @@ -14,18 +14,18 @@ export class FileDownloadService extends ServiceHelpers { downloadFile(url: string, contentType: string): void { this.http.get(url).subscribe((response: any) => { - + // It is necessary to create a new blob object with mime-type explicitly set // otherwise only Chrome works like it should const newBlob = new Blob([(response)], { type: contentType }); - + // IE doesn't allow using a blob object directly as link href // instead it is necessary to use msSaveOrOpenBlob if (window.navigator && window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(newBlob); return; } - + // For other browsers: // Create a link pointing to the ObjectURL containing the blob. const downloadURL = URL.createObjectURL(response); diff --git a/src/Ombi/ClientApp/src/app/services/index.ts b/src/Ombi/ClientApp/src/app/services/index.ts index 107cd07f2..d80212f36 100644 --- a/src/Ombi/ClientApp/src/app/services/index.ts +++ b/src/Ombi/ClientApp/src/app/services/index.ts @@ -22,3 +22,4 @@ export * from "./message.service"; export * from "./hub.service"; export * from "./system.service"; export * from "./filedownload.service"; +export * from "./settingsState.service"; \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/services/requestretry.service.ts b/src/Ombi/ClientApp/src/app/services/requestretry.service.ts index 6c8d7040b..ceace3c04 100644 --- a/src/Ombi/ClientApp/src/app/services/requestretry.service.ts +++ b/src/Ombi/ClientApp/src/app/services/requestretry.service.ts @@ -16,6 +16,6 @@ export class RequestRetryService extends ServiceHelpers { return this.http.get(this.url, {headers: this.headers}); } public deleteFailedRequest(failedId: number): Observable { - return this.http.delete(`${this.url}/${failedId}`, {headers: this.headers}); + return this.http.delete(`${this.url}${failedId}`, {headers: this.headers}); } } diff --git a/src/Ombi/ClientApp/src/app/services/settingsState.service.ts b/src/Ombi/ClientApp/src/app/services/settingsState.service.ts new file mode 100644 index 000000000..07af5719d --- /dev/null +++ b/src/Ombi/ClientApp/src/app/services/settingsState.service.ts @@ -0,0 +1,17 @@ +import { Injectable } from "@angular/core"; + +@Injectable({ + providedIn: 'root', +}) +export class SettingsStateService { + + private issuesEnabled: boolean; + + public getIssue(): boolean { + return this.issuesEnabled; + } + + public setIssue(settings: boolean): void { + this.issuesEnabled = settings; + } +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts b/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts index 5d8667db4..80420fc15 100644 --- a/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/lidarr/lidarr.component.ts @@ -109,7 +109,7 @@ export class LidarrComponent implements OnInit { this.testerService.lidarrTest(settings).subscribe(result => { if (result.isValid) { this.notificationService.success("Successfully connected to Lidarr!"); - } else if (result.expectedSubDir !== null) { + } else if (result.expectedSubDir) { this.notificationService.error("Your Lidarr Base URL must be set to " + result.expectedSubDir); } else { this.notificationService.error("We could not connect to Lidarr!"); diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.component.html index a569a6ef4..dfb047fe8 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.component.html @@ -1,6 +1,6 @@  -
+
Mobile Notifications @@ -47,7 +47,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.coponent.ts b/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.coponent.ts index e78860e09..3708f48a5 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.coponent.ts +++ b/src/Ombi/ClientApp/src/app/settings/notifications/cloudmobile.coponent.ts @@ -11,6 +11,7 @@ import { MatTableDataSource } from "@angular/material/table"; @Component({ templateUrl: "./cloudmobile.component.html", + styleUrls: ["./notificationtemplate.component.scss"] }) export class CloudMobileComponent implements OnInit { diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/gotify.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/gotify.component.html index 0b732fd74..9b2a7c938 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/gotify.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/gotify.component.html @@ -42,7 +42,7 @@
- @@ -53,7 +53,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/mattermost.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/mattermost.component.html index ea18e07e5..d7998c417 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/mattermost.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/mattermost.component.html @@ -47,7 +47,7 @@
- @@ -58,7 +58,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/mobile.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/mobile.component.html index b01a8b459..c5573c57e 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/mobile.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/mobile.component.html @@ -3,71 +3,73 @@
Legacy Mobile Notifications -
-
-
-
- - - - - +
+
+ +
+
+
- Username/Alias - - Mobile Devices Registered -
+ + + + - - - - - - + + + + + + - -
+ Username/Alias + + Mobile Devices Registered +
- {{user.username}} - - {{user.devices}} -
+ {{user.username}} + + {{user.devices}} +
-
-
- -
-
- -
- + +
-
-
- -
-
-
-
- +
+
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ + +
+
+ +
+ +
-
-
- -
-
-
- -
- - -
- +
+ +
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/notificationtemplate.component.scss b/src/Ombi/ClientApp/src/app/settings/notifications/notificationtemplate.component.scss index 33f8a2d6c..1ffd9207b 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/notificationtemplate.component.scss +++ b/src/Ombi/ClientApp/src/app/settings/notifications/notificationtemplate.component.scss @@ -1,15 +1,30 @@ @import "~styles/shared.scss"; -::ng-deep ngb-accordion > div.card { - color:white; - padding-top: 0px; -} - -::ng-deep ngb-accordion > div.card > div.card-header { - padding:0px; -} .small-middle-container{ margin: auto; width: 95%; margin-top:10px; +} + +.lmobile-actions{ + display:flex; + justify-content: left; + align-items:flex-end; +} + +.lmobile-actions .form-group{ + margin-right:10px; +} + +.lmobile-container{ + display:flex; + margin-top:10px; +} + +.issue-content{ + justify-content: flex-end; +} + +.mat-raised-button{ + margin-right:10px; } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/pushbullet.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/pushbullet.component.html index 3c4db7698..e8115e4f5 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/pushbullet.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/pushbullet.component.html @@ -32,7 +32,7 @@
- @@ -43,7 +43,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/pushover.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/pushover.component.html index 8ce9b401d..926b344e0 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/pushover.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/pushover.component.html @@ -74,7 +74,7 @@
- @@ -85,7 +85,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/slack.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/slack.component.html index 15ef796fc..378e48060 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/slack.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/slack.component.html @@ -57,7 +57,7 @@
- @@ -68,7 +68,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/telegram.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/telegram.component.html index d89d14483..51e4c36d4 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/telegram.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/telegram.component.html @@ -43,7 +43,7 @@
- @@ -52,7 +52,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/notifications/webhook.component.html b/src/Ombi/ClientApp/src/app/settings/notifications/webhook.component.html index 8ab28cc3c..aab095953 100644 --- a/src/Ombi/ClientApp/src/app/settings/notifications/webhook.component.html +++ b/src/Ombi/ClientApp/src/app/settings/notifications/webhook.component.html @@ -31,7 +31,7 @@
- @@ -40,7 +40,7 @@
- +
diff --git a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts index df804a08c..d4c5a9883 100644 --- a/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/radarr/radarr.component.ts @@ -99,7 +99,7 @@ export class RadarrComponent implements OnInit { this.testerService.radarrTest(settings).subscribe(result => { if (result.isValid) { this.notificationService.success("Successfully connected to Radarr!"); - } else if (result.expectedSubDir !== null) { + } else if (result.expectedSubDir) { this.notificationService.error("Your Radarr Base URL must be set to " + result.expectedSubDir); } else { this.notificationService.error("We could not connect to Radarr!"); diff --git a/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts b/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts index edd22bbdd..09f86859a 100644 --- a/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts +++ b/src/Ombi/ClientApp/src/app/settings/sonarr/sonarr.component.ts @@ -153,7 +153,7 @@ export class SonarrComponent implements OnInit { this.testerService.sonarrTest(settings).subscribe(result => { if (result.isValid) { this.notificationService.success("Successfully connected to Sonarr!"); - } else if (result.expectedSubDir !== null) { + } else if (result.expectedSubDir) { this.notificationService.error("Your Sonarr Base URL must be set to " + result.expectedSubDir); } else { this.notificationService.error("We could not connect to Sonarr!"); diff --git a/src/Ombi/ClientApp/src/index.html b/src/Ombi/ClientApp/src/index.html index 57d663a05..9b4005ca1 100644 --- a/src/Ombi/ClientApp/src/index.html +++ b/src/Ombi/ClientApp/src/index.html @@ -3,6 +3,11 @@ + @@ -29,21 +34,33 @@ diff --git a/src/Ombi/ClientApp/src/styles/Styles.scss b/src/Ombi/ClientApp/src/styles/Styles.scss index df9e6028d..55bc8657c 100644 --- a/src/Ombi/ClientApp/src/styles/Styles.scss +++ b/src/Ombi/ClientApp/src/styles/Styles.scss @@ -145,3 +145,15 @@ hr{ border-top: 1px solid $ombi-background-primary; } + + .form-control{ + background-color: $ombi-background-accent; + color:#FFF; + border: 1px solid $ombi-background-accent; + } + + .form-control:focus{ + background-color: $ombi-background-accent; + color:#FFF; + border: 1px solid $ombi-active; + } diff --git a/src/Ombi/ClientApp/src/styles/material-overrides.scss b/src/Ombi/ClientApp/src/styles/material-overrides.scss index e020b0532..cbc03782e 100644 --- a/src/Ombi/ClientApp/src/styles/material-overrides.scss +++ b/src/Ombi/ClientApp/src/styles/material-overrides.scss @@ -27,7 +27,8 @@ td.mat-cell { .mat-dialog-container, .mat-menu-content, .mat-table, -.mat-paginator { +.mat-paginator, +.mat-select-panel { background: $ombi-background-accent; } diff --git a/src/Ombi/Controllers/V1/External/TesterController.cs b/src/Ombi/Controllers/V1/External/TesterController.cs index 82182c012..df6491578 100644 --- a/src/Ombi/Controllers/V1/External/TesterController.cs +++ b/src/Ombi/Controllers/V1/External/TesterController.cs @@ -374,7 +374,7 @@ namespace Ombi.Controllers.V1.External var result = await RadarrApi.SystemStatus(settings.ApiKey, settings.FullUri); return new TesterResultModel { - IsValid = result.urlBase == settings.SubDir, + IsValid = result.urlBase == settings.SubDir || string.IsNullOrEmpty(result.urlBase) && string.IsNullOrEmpty(settings.SubDir), ExpectedSubDir = result.urlBase }; } @@ -399,7 +399,7 @@ namespace Ombi.Controllers.V1.External var result = await SonarrApi.SystemStatus(settings.ApiKey, settings.FullUri); return new TesterResultModel { - IsValid = result.urlBase == settings.SubDir, + IsValid = result.urlBase == settings.SubDir || string.IsNullOrEmpty(result.urlBase) && string.IsNullOrEmpty(settings.SubDir), ExpectedSubDir = result.urlBase }; } @@ -513,7 +513,7 @@ namespace Ombi.Controllers.V1.External var status = await LidarrApi.Status(settings.ApiKey, settings.FullUri); return new TesterResultModel { - IsValid = status?.urlBase == settings.SubDir, + IsValid = status?.urlBase == settings.SubDir || string.IsNullOrEmpty(status.urlBase) && string.IsNullOrEmpty(settings.SubDir), ExpectedSubDir = status?.urlBase }; } diff --git a/src/Ombi/Controllers/V1/IdentityController.cs b/src/Ombi/Controllers/V1/IdentityController.cs index 342e4620d..dfe13a029 100644 --- a/src/Ombi/Controllers/V1/IdentityController.cs +++ b/src/Ombi/Controllers/V1/IdentityController.cs @@ -299,7 +299,8 @@ namespace Ombi.Controllers.V1 model.Add(new UserViewModelDropdown { Id = user.Id, - Username = user.UserName + Username = user.UserName, + Email = user.Email }); } diff --git a/src/Ombi/Controllers/V1/ImagesController.cs b/src/Ombi/Controllers/V1/ImagesController.cs index 249a6e9bd..c119efe70 100644 --- a/src/Ombi/Controllers/V1/ImagesController.cs +++ b/src/Ombi/Controllers/V1/ImagesController.cs @@ -203,7 +203,7 @@ namespace Ombi.Controllers.V1 var item = rand.Next(moviesArray.Length); var result = await _cache.GetOrAdd($"{CacheKeys.FanartTv}movie{moviesArray[item]}", async () => await FanartTvApi.GetMovieImages(moviesArray[item].ToString(), key.Value), DateTime.Now.AddDays(1)); - while (!result.moviebackground.Any()) + while (!result.moviebackground?.Any() ?? true) { item = rand.Next(moviesArray.Length); result = await _cache.GetOrAdd($"{CacheKeys.FanartTv}movie{moviesArray[item]}", async () => await FanartTvApi.GetMovieImages(moviesArray[item].ToString(), key.Value), DateTime.Now.AddDays(1)); @@ -220,7 +220,7 @@ namespace Ombi.Controllers.V1 var item = rand.Next(tvArray.Length); var result = await _cache.GetOrAdd($"{CacheKeys.FanartTv}tv{tvArray[item]}", async () => await FanartTvApi.GetTvImages(tvArray[item], key.Value), DateTime.Now.AddDays(1)); - while (!result.showbackground.Any()) + while (!result.showbackground?.Any() ?? true) { item = rand.Next(tvArray.Length); result = await _cache.GetOrAdd($"{CacheKeys.FanartTv}tv{tvArray[item]}", async () => await FanartTvApi.GetTvImages(tvArray[item], key.Value), DateTime.Now.AddDays(1)); diff --git a/src/Ombi/Controllers/V1/LandingPageController.cs b/src/Ombi/Controllers/V1/LandingPageController.cs index 54e1638b4..5f054165b 100644 --- a/src/Ombi/Controllers/V1/LandingPageController.cs +++ b/src/Ombi/Controllers/V1/LandingPageController.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Ombi.Api.Emby; +using Ombi.Api.Jellyfin; using Ombi.Api.Plex; using Ombi.Core.Settings; using Ombi.Core.Settings.Models.External; @@ -18,19 +19,22 @@ namespace Ombi.Controllers.V1 public class LandingPageController : ControllerBase { public LandingPageController(ISettingsService plex, ISettingsService emby, - IPlexApi plexApi, IEmbyApiFactory embyApi) + IPlexApi plexApi, IEmbyApiFactory embyApi, ISettingsService jellyfin, IJellyfinApi jellyfinApi) { _plexSettings = plex; _embySettings = emby; _plexApi = plexApi; _embyApi = embyApi; + _jellyfin = jellyfin; + _jellyfinApi = jellyfinApi; } private readonly IPlexApi _plexApi; private readonly IEmbyApiFactory _embyApi; private readonly ISettingsService _plexSettings; private readonly ISettingsService _embySettings; - + private readonly ISettingsService _jellyfin; + private readonly IJellyfinApi _jellyfinApi; [HttpGet] public async Task GetMediaServerStatus() @@ -86,6 +90,31 @@ namespace Ombi.Controllers.V1 } } } + + + var jellyfin = await _jellyfin.GetSettingsAsync(); + if (jellyfin.Enable) + { + foreach (var server in jellyfin.Servers) + { + try + { + var result = await _jellyfinApi.GetUsers(server.FullUri, server.ApiKey); + if (result.Any()) + { + model.ServersAvailable++; + } + else + { + model.ServersUnavailable++; + } + } + catch (Exception) + { + model.ServersUnavailable++; + } + } + } return model; } } diff --git a/src/Ombi/Controllers/V1/TokenController.cs b/src/Ombi/Controllers/V1/TokenController.cs index 66013ecf5..f9ea57a5c 100644 --- a/src/Ombi/Controllers/V1/TokenController.cs +++ b/src/Ombi/Controllers/V1/TokenController.cs @@ -146,7 +146,7 @@ namespace Ombi.Controllers.V1 var token = new JwtSecurityToken( claims: claims, - expires: rememberMe ? DateTime.Now.AddDays(7) : DateTime.Now.AddDays(1), + expires: rememberMe ? DateTime.Now.AddYears(1) : DateTime.Now.AddDays(7), signingCredentials: creds, audience: "Ombi", issuer: "Ombi" ); diff --git a/src/Ombi/appsettings.json b/src/Ombi/appsettings.json index 9dcf5523a..8f1f3848d 100644 --- a/src/Ombi/appsettings.json +++ b/src/Ombi/appsettings.json @@ -25,24 +25,40 @@ 399106, 351286, 348350, + 539885, + 508442, + 664767, 260513, 372058, 299536, + 581389, + 577922, 383498, 330457, + 755812, + 495764, + 14160, 429617, 475557, 420818, + 775996, 283995 ], "TvShows": [ 121361, + 361753, + 295685, 74205, + 362392, 81189, 79126, + 332858, + 73762, 79349, + 349309, 275274, 305288, + 260449, 296762, 280619, 305074,