diff --git a/src/Ombi/ClientApp/src/app/media-details/movie-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/movie-details.component.ts
index c8c5a3319..c28d2eb91 100644
--- a/src/Ombi/ClientApp/src/app/media-details/movie-details.component.ts
+++ b/src/Ombi/ClientApp/src/app/media-details/movie-details.component.ts
@@ -1,9 +1,9 @@
import { Component } from "@angular/core";
-import { ImageService, SearchV2Service } from "../services";
+import { ImageService, SearchV2Service, RequestService } from "../services";
import { ActivatedRoute } from "@angular/router";
import { DomSanitizer } from "@angular/platform-browser";
import { ISearchMovieResultV2 } from "../interfaces/ISearchMovieResultV2";
-import { MatDialog } from "@angular/material";
+import { MatDialog, MatSnackBar } from "@angular/material";
import { MovieDetailsTrailerComponent } from "./movie-details-trailer.component";
@Component({
@@ -16,7 +16,8 @@ export class MovieDetailsComponent {
constructor(private searchService: SearchV2Service, private route: ActivatedRoute,
private sanitizer: DomSanitizer, private imageService: ImageService,
- public dialog: MatDialog) {
+ public dialog: MatDialog, private requestService: RequestService,
+ public snackBar: MatSnackBar) {
this.route.params.subscribe((params: any) => {
this.theMovidDbId = params.movieDbId;
this.load();
@@ -34,8 +35,18 @@ export class MovieDetailsComponent {
}
- public request() {
- //
+ public async request() {
+ var result = await this.requestService.requestMovie({theMovieDbId: this.theMovidDbId, languageCode: null}).toPromise();
+ if(result.result) {
+ this.movie.requested = true;
+ this.snackBar.open(result.message, "Ok", {
+ duration:3000
+ });
+ } else {
+ this.snackBar.open(result.errorMessage, "Ok", {
+ duration:3000,
+ });
+ }
}
public openDialog() {
diff --git a/src/Ombi/ClientApp/src/app/shared/shared.module.ts b/src/Ombi/ClientApp/src/app/shared/shared.module.ts
index c28e69183..50c1da1eb 100644
--- a/src/Ombi/ClientApp/src/app/shared/shared.module.ts
+++ b/src/Ombi/ClientApp/src/app/shared/shared.module.ts
@@ -11,7 +11,8 @@ import { InputSwitchModule, SidebarModule } from "primeng/primeng";
import {
MatButtonModule, MatNativeDateModule, MatIconModule, MatSidenavModule, MatListModule, MatToolbarModule, MatTooltipModule} from '@angular/material';
- import { MatCardModule, MatInputModule, MatTabsModule, MatAutocompleteModule, MatCheckboxModule, MatExpansionModule, MatDialogModule, MatProgressSpinnerModule } from "@angular/material";
+ import { MatCardModule, MatInputModule, MatTabsModule, MatAutocompleteModule, MatCheckboxModule, MatExpansionModule, MatDialogModule, MatProgressSpinnerModule,
+ MatSnackBarModule } from "@angular/material";
@NgModule({
declarations: [
@@ -38,10 +39,12 @@ import {
MatCheckboxModule,
MatExpansionModule,
MatDialogModule,
+ MatSnackBarModule,
],
exports: [
TranslateModule,
CommonModule,
+ MatSnackBarModule,
FormsModule,
SidebarModule,
MatProgressSpinnerModule,