Currently Online
The media server is currently online
diff --git a/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts b/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts
index bfa96fb9e..f5d13420b 100644
--- a/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts
+++ b/src/Ombi/ClientApp/app/landingpage/landingpage.component.ts
@@ -29,6 +29,8 @@ export class LandingPageComponent implements OnInit {
});
- this.landingPageService.getServerStatus().subscribe(x => this.mediaServerStatus = x);
+ this.landingPageService.getServerStatus().subscribe(x => {
+ this.mediaServerStatus = x;
+ });
}
}
diff --git a/src/Ombi/ClientApp/app/login/login.component.html b/src/Ombi/ClientApp/app/login/login.component.html
index 1e621e1aa..9458b07fc 100644
--- a/src/Ombi/ClientApp/app/login/login.component.html
+++ b/src/Ombi/ClientApp/app/login/login.component.html
@@ -9,7 +9,7 @@ include the remember me checkbox
@@ -68,7 +68,7 @@
Available
Processing Request
-
Pending Approval
+
Pending Approval
diff --git a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts
index d6ca8d432..5bccbd17e 100644
--- a/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts
+++ b/src/Ombi/ClientApp/app/requests/tvrequest-children.component.ts
@@ -1,6 +1,6 @@
import { Component, Input } from "@angular/core";
import { IChildRequests, IEpisodesRequests } from "../interfaces";
-import { RequestService } from "../services";
+import { NotificationService, RequestService } from "../services";
@Component({
selector:"tvrequests-children",
@@ -9,7 +9,9 @@ import { RequestService } from "../services";
export class TvRequestChildrenComponent {
@Input() public childRequests: IChildRequests[];
@Input() public isAdmin: boolean;
- constructor(private requestService: RequestService ) { }
+ constructor(private requestService: RequestService,
+ private notificationService: NotificationService) { }
+
public removeRequest(request: IChildRequests) {
this.requestService.deleteChild(request)
.subscribe();
@@ -36,8 +38,21 @@ export class TvRequestChildrenComponent {
public approve(request: IChildRequests) {
request.approved = true;
request.denied = false;
- this.requestService.updateChild(request)
- .subscribe();
+ request.seasonRequests.forEach((season) => {
+ season.episodes.forEach((ep) => {
+ ep.approved = true;
+ });
+ });
+ this.requestService.approveChild(request)
+ .subscribe(x => {
+ if (x.requestAdded) {
+ this.notificationService.success("Request Approved",
+ `Request has been approved successfully`);
+ } else {
+ this.notificationService.warning("Request Approved", x.message ? x.message : x.errorMessage);
+ request.approved = false;
+ }
+ });
}
public denySeasonRequest(request: IChildRequests) {
diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.html b/src/Ombi/ClientApp/app/requests/tvrequests.component.html
index e515ee47a..22021fa28 100644
--- a/src/Ombi/ClientApp/app/requests/tvrequests.component.html
+++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.html
@@ -19,11 +19,6 @@
(scrolled)="loadMore()">-->
-
+
diff --git a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts
index eed66b1cc..f46d1d86b 100644
--- a/src/Ombi/ClientApp/app/requests/tvrequests.component.ts
+++ b/src/Ombi/ClientApp/app/requests/tvrequests.component.ts
@@ -1,8 +1,7 @@
-import { Component, OnDestroy, OnInit, ViewEncapsulation } from "@angular/core";
+import { Component, OnInit } from "@angular/core";
import "rxjs/add/operator/debounceTime";
import "rxjs/add/operator/distinctUntilChanged";
import "rxjs/add/operator/map";
-import "rxjs/add/operator/takeUntil";
import { Subject } from "rxjs/Subject";
import "rxjs/add/operator/debounceTime";
@@ -13,18 +12,14 @@ import { AuthService } from "../auth/auth.service";
import { RequestService } from "../services";
import { TreeNode } from "primeng/primeng";
-import { IChildRequests, IEpisodesRequests, INewSeasonRequests, ITvRequests } from "../interfaces";
+import { ITvRequests } from "../interfaces";
@Component({
selector: "tv-requests",
templateUrl: "./tvrequests.component.html",
styleUrls: ["./tvrequests.component.scss"],
- //Was required to turn off encapsulation since CSS only should be overridden for this component
- //However when encapsulation is on angular injects prefixes to all classes so css selectors
- //Stop working
- encapsulation: ViewEncapsulation.None,
})
-export class TvRequestsComponent implements OnInit, OnDestroy {
+export class TvRequestsComponent implements OnInit {
public tvRequests: TreeNode[];
public searchChanged = new Subject
();
@@ -35,23 +30,20 @@ export class TvRequestsComponent implements OnInit, OnDestroy {
private currentlyLoaded: number;
private amountToLoad: number;
- private subscriptions = new Subject();
constructor(private requestService: RequestService,
private auth: AuthService) {
this.searchChanged
.debounceTime(600) // Wait Xms afterthe last event before emitting last event
.distinctUntilChanged() // only emit if value is different from previous value
- .takeUntil(this.subscriptions)
.subscribe(x => {
this.searchText = x as string;
if (this.searchText === "") {
this.resetSearch();
return;
}
- this.requestService.searchTvRequests(this.searchText)
- .takeUntil(this.subscriptions)
- .subscribe(m => this.tvRequests = this.transformData(m));
+ this.requestService.searchTvRequestsTree(this.searchText)
+ .subscribe(m => this.tvRequests = m);
});
}
public openClosestTab(el: any) {
@@ -78,30 +70,7 @@ export class TvRequestsComponent implements OnInit, OnDestroy {
}
}
}
- public transformData(data: ITvRequests[]): TreeNode[] {
- const temp: TreeNode[] = [];
- data.forEach((value) => {
- temp.push({
- data: value,
- children: [{
- data: this.fixEpisodeSort(value.childRequests), leaf: true,
- }],
- leaf: false,
- });
- }, this);
- return temp;
- }
- public fixEpisodeSort(items: IChildRequests[]) {
- items.forEach((value) => {
- value.seasonRequests.forEach((requests: INewSeasonRequests) => {
- requests.episodes.sort((a: IEpisodesRequests, b: IEpisodesRequests) => {
- return a.episodeNumber - b.episodeNumber;
- });
- });
- });
- return items;
- }
public ngOnInit() {
this.amountToLoad = 1000;
this.currentlyLoaded = 5;
@@ -116,10 +85,9 @@ export class TvRequestsComponent implements OnInit, OnDestroy {
//if you scroll really quickly then you start getting duplicates of movies
//since it's async and some subsequent results return first and then incrementer
//is increased so you see movies which had already been gotten show up...
- this.requestService.getTvRequests(this.amountToLoad, this.currentlyLoaded + 1)
- .takeUntil(this.subscriptions)
+ this.requestService.getTvRequestsTree(this.amountToLoad, this.currentlyLoaded + 1)
.subscribe(x => {
- this.tvRequests.push.apply(this.tvRequests, this.transformData(x));
+ this.tvRequests = x;
this.currentlyLoaded = this.currentlyLoaded + this.amountToLoad;
});
}
@@ -128,87 +96,15 @@ export class TvRequestsComponent implements OnInit, OnDestroy {
this.searchChanged.next(text.target.value);
}
- public removeRequest(request: ITvRequests) {
- this.requestService.removeTvRequest(request);
- this.removeRequestFromUi(request);
- }
-
- public changeAvailability(request: IChildRequests, available: boolean) {
- request.available = available;
-
- //this.updateRequest(request);
- }
-
- //Was already here but not sure what's using it...'
- //public approve(request: IChildRequests) {
- // request.approved = true;
- // request.denied = false;
- // //this.updateRequest(request);
- //}
- public approve(request: IChildRequests) {
- request.approved = true;
- request.denied = false;
- this.requestService.updateChild(request)
- .subscribe();
- }
- //Was already here but not sure what's using it...'
- //public deny(request: IChildRequests) {
- // request.approved = false;
- // request.denied = true;
- // //this.updateRequest(request);
- //}
- public deny(request: IChildRequests) {
- request.approved = false;
- request.denied = true;
- this.requestService.updateChild(request)
- .subscribe();
- }
-
- public approveSeasonRequest(request: IChildRequests) {
- request.approved = true;
- request.denied = false;
- this.requestService.updateTvRequest(this.selectedSeason)
- .subscribe();
- }
-
- public denySeasonRequest(request: IChildRequests) {
- request.approved = false;
- request.denied = true;
- this.requestService.updateTvRequest(this.selectedSeason)
- .subscribe();
- }
-
public showChildren(request: ITvRequests) {
this.selectedSeason = request;
this.showChildDialogue = true;
}
- public getColour(ep: IEpisodesRequests): string {
- if (ep.available) {
- return "lime";
- }
- if (ep.approved) {
- return "#00c0ff";
- }
- return "white";
- }
-
- public ngOnDestroy() {
- this.subscriptions.next();
- this.subscriptions.complete();
- }
-
- //private updateRequest(request: ITvRequests) {
- // this.requestService.updateTvRequest(request)
- // .takeUntil(this.subscriptions)
- // .subscribe(x => request = x);
- //}
-
private loadInit() {
- this.requestService.getTvRequests(this.amountToLoad, 0)
- .takeUntil(this.subscriptions)
+ this.requestService.getTvRequestsTree(this.amountToLoad, 0)
.subscribe(x => {
- this.tvRequests = this.transformData(x);
+ this.tvRequests = x;
});
}
@@ -216,11 +112,4 @@ export class TvRequestsComponent implements OnInit, OnDestroy {
this.currentlyLoaded = 5;
this.loadInit();
}
-
- private removeRequestFromUi(key: ITvRequests) {
- const index = this.tvRequests.findIndex(x => x.data === key);
- if (index > -1) {
- this.tvRequests.splice(index, 1);
- }
- }
}
diff --git a/src/Ombi/ClientApp/app/search/seriesinformation.component.html b/src/Ombi/ClientApp/app/search/seriesinformation.component.html
index ce71207be..5b546b722 100644
--- a/src/Ombi/ClientApp/app/search/seriesinformation.component.html
+++ b/src/Ombi/ClientApp/app/search/seriesinformation.component.html
@@ -55,14 +55,15 @@
Available
- Processing Request
- Pending Approval
+ Processing Request
+ Selected
+ Pending Approval
Not Requested
|
-
-
+
+
|
diff --git a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts
index 34124acd9..4b68ba305 100644
--- a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts
+++ b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts
@@ -54,10 +54,12 @@ export class SeriesInformationComponent implements OnInit, OnDestroy {
public addRequest(episode: IEpisodesRequests) {
episode.requested = true;
+ episode.selected = true;
}
public removeRequest(episode: IEpisodesRequests) {
episode.requested = false;
+ episode.selected = false;
}
public ngOnDestroy() {
diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.html b/src/Ombi/ClientApp/app/search/tvsearch.component.html
index 8a9f6051a..a6e6ae7fb 100644
--- a/src/Ombi/ClientApp/app/search/tvsearch.component.html
+++ b/src/Ombi/ClientApp/app/search/tvsearch.component.html
@@ -59,7 +59,7 @@
Air Date: {{node.data.firstAired | date: 'dd/MM/yyyy'}}
- Available
+ Available
diff --git a/src/Ombi/ClientApp/app/services/applications/plex.service.ts b/src/Ombi/ClientApp/app/services/applications/plex.service.ts
index de71f6ccb..75e2d8148 100644
--- a/src/Ombi/ClientApp/app/services/applications/plex.service.ts
+++ b/src/Ombi/ClientApp/app/services/applications/plex.service.ts
@@ -6,7 +6,7 @@ import { Observable } from "rxjs/Rx";
import { ServiceAuthHelpers } from "../service.helpers";
-import { IPlexAuthentication, IPlexLibraries, IPlexServerViewModel } from "../../interfaces";
+import { IPlexAuthentication, IPlexLibResponse, IPlexServerViewModel } from "../../interfaces";
import { IPlexServer } from "../../interfaces";
@Injectable()
@@ -23,7 +23,7 @@ export class PlexService extends ServiceAuthHelpers {
return this.http.post(`${this.url}servers`, JSON.stringify({ login, password }), { headers: this.headers }).map(this.extractData);
}
- public getLibraries(plexSettings: IPlexServer): Observable {
+ public getLibraries(plexSettings: IPlexServer): Observable {
return this.http.post(`${this.url}Libraries`, JSON.stringify(plexSettings), { headers: this.headers }).map(this.extractData).catch(this.handleError);
}
diff --git a/src/Ombi/ClientApp/app/services/request.service.ts b/src/Ombi/ClientApp/app/services/request.service.ts
index 13714f757..adc24f2eb 100644
--- a/src/Ombi/ClientApp/app/services/request.service.ts
+++ b/src/Ombi/ClientApp/app/services/request.service.ts
@@ -3,6 +3,7 @@ import { Http } from "@angular/http";
import { AuthHttp } from "angular2-jwt";
import { Observable } from "rxjs/Rx";
+import { TreeNode } from "primeng/primeng";
import { IRequestEngineResult } from "../interfaces";
import { IChildRequests, IMovieRequests, IRequestCountModel, IRequestGrid, ITvRequests } from "../interfaces";
import { ISearchMovieResult } from "../interfaces";
@@ -23,6 +24,10 @@ export class RequestService extends ServiceAuthHelpers {
return this.http.post(`${this.url}TV/`, JSON.stringify(tv), { headers: this.headers }).map(this.extractData);
}
+ public approveMovie(movie: IMovieRequests): Observable {
+ return this.http.post(`${this.url}Movie/Approve`, JSON.stringify(movie), { headers: this.headers }).map(this.extractData);
+ }
+
public getMovieRequests(count: number, position: number): Observable {
return this.http.get(`${this.url}movie/${count}/${position}`).map(this.extractData);
}
@@ -44,6 +49,11 @@ export class RequestService extends ServiceAuthHelpers {
.catch(this.handleError);
}
+ public getTvRequestsTree(count: number, position: number): Observable {
+ return this.http.get(`${this.url}tv/${count}/${position}/tree`).map(this.extractData)
+ .catch(this.handleError);
+ }
+
public getChildRequests(requestId: number): Observable {
return this.http.get(`${this.url}tv/${requestId}/child`).map(this.extractData)
.catch(this.handleError);
@@ -51,6 +61,10 @@ export class RequestService extends ServiceAuthHelpers {
public searchTvRequests(search: string): Observable {
return this.http.get(`${this.url}tv/search/${search}`).map(this.extractData);
+ }
+
+ public searchTvRequestsTree(search: string): Observable {
+ return this.http.get(`${this.url}tv/search/${search}/tree`).map(this.extractData);
}
public removeTvRequest(request: ITvRequests) {
@@ -62,6 +76,9 @@ export class RequestService extends ServiceAuthHelpers {
}
public updateChild(child: IChildRequests): Observable {
return this.http.put(`${this.url}tv/child`, JSON.stringify(child), { headers: this.headers }).map(this.extractData);
+ }
+ public approveChild(child: IChildRequests): Observable {
+ return this.http.post(`${this.url}tv/child/approve`, JSON.stringify(child), { headers: this.headers }).map(this.extractData);
}
public deleteChild(child: IChildRequests): Observable {
return this.http.delete(`${this.url}tv/child/${child.id}`, { headers: this.headers }).map(this.extractData);
diff --git a/src/Ombi/ClientApp/app/services/service.helpers.ts b/src/Ombi/ClientApp/app/services/service.helpers.ts
index 8a8019651..702b6db3c 100644
--- a/src/Ombi/ClientApp/app/services/service.helpers.ts
+++ b/src/Ombi/ClientApp/app/services/service.helpers.ts
@@ -1,4 +1,5 @@
import { Headers, Http, Response } from "@angular/http";
+import "rxjs/add/observable/throw";
import { Observable } from "rxjs/Observable";
import { AuthHttp } from "angular2-jwt";
diff --git a/src/Ombi/ClientApp/app/settings/emby/emby.component.html b/src/Ombi/ClientApp/app/settings/emby/emby.component.html
index 16f3e2d8b..78b2fed02 100644
--- a/src/Ombi/ClientApp/app/settings/emby/emby.component.html
+++ b/src/Ombi/ClientApp/app/settings/emby/emby.component.html
@@ -24,7 +24,7 @@
-
+
@@ -76,23 +76,20 @@