diff --git a/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts b/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts
index 4cebae814..aba34bff9 100644
--- a/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts
+++ b/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts
@@ -45,9 +45,9 @@ export class DiscoverActorComponent implements AfterViewInit {
this.discoverResults = [];
this.actorCredits.cast.forEach(m => {
this.discoverResults.push({
- available: false,
+ available: false,
posterPath: m.poster_path ? `https://image.tmdb.org/t/p/w300/${m.poster_path}` : "../../../images/default_movie_poster.png",
- requested: false,
+ requested: false,
title: m.title,
type: RequestType.movie,
id: m.id,
@@ -56,6 +56,7 @@ export class DiscoverActorComponent implements AfterViewInit {
overview: m.overview,
approved: false,
imdbid: "",
+ denied: false
});
});
}
diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.html b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.html
index 1a67b243e..877d799d0 100644
--- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.html
+++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.html
@@ -76,24 +76,24 @@
[translate]="'Common.NotRequested'">
-
- {{'Discovery.CardDetails.Director' | translate}}:
- {{movie.credits.crew[0].name}}
- Director:
- {{tvCreator}}
-
-
- {{'Discovery.CardDetails.InCinemas' | translate}}:
- {{movie.releaseDate | amLocal | amDateFormat: 'LL'}}
- {{'Discovery.CardDetails.FirstAired' | translate}}:
- {{tv.firstAired | amLocal | amDateFormat: 'LL'}}
-
-
- {{'Discovery.CardDetails.Writer' | translate}}:
- {{movie.credits.crew[1].name}}
- {{'Discovery.CardDetails.ExecProducer' | translate}}:
- {{tvProducer}}
-
+
+ {{'Discovery.CardDetails.Director' | translate}}:
+ {{movie.credits.crew[0].name}}
+ Director:
+ {{tvCreator}}
+
+
+ {{'Discovery.CardDetails.InCinemas' | translate}}:
+ {{movie.releaseDate | amLocal | amDateFormat: 'LL'}}
+ {{'Discovery.CardDetails.FirstAired' | translate}}:
+ {{tv.firstAired | amLocal | amDateFormat: 'LL'}}
+
+
+ {{'Discovery.CardDetails.Writer' | translate}}:
+ {{movie.credits.crew[1].name}}
+ {{'Discovery.CardDetails.ExecProducer' | translate}}:
+ {{tvProducer}}
+
diff --git a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.ts b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.ts
index 2fdca057a..108db606c 100644
--- a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.ts
+++ b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.ts
@@ -54,10 +54,11 @@ export class DiscoverCollectionsComponent implements OnInit {
overview: m.overview,
approved: m.approved,
imdbid: m.imdbId,
+ denied:false
});
});
}
-
+
private loading() {
this.loadingFlag = true;
}
diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html
index d50a965c4..cb95a7524 100644
--- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html
+++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html
@@ -1,13 +1,23 @@
-
+
+
+
+ dashboard
+ calendar_view_day
+
+
+
+
+
+
@@ -16,11 +26,16 @@
-
+
+
diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts
index ada8b379e..c604a3b31 100644
--- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts
+++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts
@@ -1,7 +1,7 @@
import { Component, OnInit, Inject } from "@angular/core";
import { SearchV2Service } from "../../../services";
import { ISearchMovieResult, ISearchTvResult, RequestType } from "../../../interfaces";
-import { IDiscoverCardResult, DiscoverOption } from "../../interfaces";
+import { IDiscoverCardResult, DiscoverOption, DisplayOption } from "../../interfaces";
import { trigger, transition, style, animate } from "@angular/animations";
import { StorageService } from "../../../shared/storage/storage-service";
import { DOCUMENT } from "@angular/common";
@@ -26,6 +26,8 @@ export class DiscoverComponent implements OnInit {
public discoverOptions: DiscoverOption = DiscoverOption.Combined;
public DiscoverOption = DiscoverOption;
+ public displayOption: DisplayOption = DisplayOption.Card;
+ public DisplayOption = DisplayOption;
public defaultTvPoster: string;
@@ -41,6 +43,7 @@ export class DiscoverComponent implements OnInit {
private contentLoaded: number;
private isScrolling: boolean = false;
private mediaTypeStorageKey = "DiscoverOptions";
+ private displayOptionsKey = "DiscoverDisplayOptions";
constructor(private searchService: SearchV2Service,
private storageService: StorageService,
@@ -53,6 +56,10 @@ export class DiscoverComponent implements OnInit {
if (localDiscoverOptions) {
this.discoverOptions = DiscoverOption[DiscoverOption[localDiscoverOptions]];
}
+ const localDisplayOptions = +this.storageService.get(this.displayOptionsKey);
+ if (localDisplayOptions) {
+ this.displayOption = DisplayOption[DisplayOption[localDisplayOptions]];
+ }
this.scrollDisabled = true;
switch (this.discoverOptions) {
case DiscoverOption.Combined:
@@ -221,6 +228,11 @@ export class DiscoverComponent implements OnInit {
this.finishLoading();
}
+ public changeView(view: DisplayOption) {
+ this.displayOption = view;
+ this.storageService.save(this.displayOptionsKey, view.toString());
+ }
+
private createModel() {
const tempResults =
[];
@@ -257,7 +269,8 @@ export class DiscoverComponent implements OnInit {
rating: m.voteAverage,
overview: m.overview,
approved: m.approved,
- imdbid: m.imdbId
+ imdbid: m.imdbId,
+ denied: false
});
});
return tempResults;
@@ -277,7 +290,8 @@ export class DiscoverComponent implements OnInit {
rating: +m.rating,
overview: m.overview,
approved: m.approved,
- imdbid: m.imdbId
+ imdbid: m.imdbId,
+ denied: false
});
});
return tempResults;
diff --git a/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.html b/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.html
new file mode 100644
index 000000000..5c6039258
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.html
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+
+
+
{{result.title}}
+
+
+
+
+
+ {{'Discovery.CardDetails.Studio' | translate}}: {{movie.productionCompanies[0].name}}
+
+ {{'Discovery.CardDetails.Network' | translate}}: {{tv.network.name}}
+
+ {{'Discovery.CardDetails.Director' | translate}}: {{movie.credits.crew[0].name}}
+
+ Director: {{tvCreator}}
+
+ {{'Discovery.CardDetails.InCinemas' | translate}}: {{movie.releaseDate | amLocal | amDateFormat: 'LL'}}
+
+ {{'Discovery.CardDetails.FirstAired' | translate}}: {{tv.firstAired | amLocal | amDateFormat: 'LL'}}
+
+ {{'Discovery.CardDetails.Writer' | translate}}: {{movie.credits.crew[1].name}}
+
+ {{'Discovery.CardDetails.ExecProducer' | translate}}: {{tvProducer}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.scss b/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.scss
new file mode 100644
index 000000000..3e05e3c48
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.scss
@@ -0,0 +1,132 @@
+$ombi-primary:#3f3f3f;
+$card-background: #2b2b2b;
+
+$blue: #1976D2;
+$pink: #C2185B;
+$green:#1DE9B6;
+$orange:#F57C00;
+
+.btn-blue {
+ background-color: $blue;
+}
+
+.btn-pink {
+ background-color: $pink;
+}
+
+.btn-green {
+ background-color: $green;
+}
+
+.btn-orange {
+ background-color: $orange;
+}
+
+.btn-spacing {
+ margin-top:10%;
+}
+
+#cardImage {
+ border-radius: 5px 5px 0px 0px;
+ height: 75%;
+}
+
+.dark-card {
+ border-radius: 8px;
+}
+
+// Changed height to 100% to make all cards the same height
+.top-spacing {
+ margin-top: 1%;
+}
+
+.card-poster {
+ width: 100%;
+ border-radius: 8px 0px 0px 8px;
+ margin-top: -6.5%;
+ margin-bottom: -6.6%;
+}
+
+.main-container {
+ margin-left: -2%;
+}
+
+
+.rating {
+ position: absolute;
+ font-weight: bold;
+}
+
+$border-width: 3px;
+
+.available {
+ background-color: #1DE9B6 !important;
+ color: black !important;
+}
+
+.approved {
+ background-color: #ff5722 !important;
+}
+
+.requested {
+ background-color: #ffd740 !important;
+ color: black !important;
+}
+
+.denied {
+ background-color: #C2185B !important;
+}
+
+.notrequested {
+ background-color: #303030 !important;
+}
+
+.expand {
+ text-align: center;
+}
+
+@media (min-width: 1025px) {
+
+ // Changed height to 100% to make all cards the same height
+ .grow {
+ transition: all .2s ease-in-out;
+ height: 100%;
+ }
+
+ .grow:hover {
+ transform: scale(1.1);
+ }
+}
+
+::ng-deep mat-dialog-container.mat-dialog-container {
+ // background-color: $ombi-primary;
+ // color: white;
+ border-radius: 2%
+}
+
+
+/* Title adjust for the Discover page */
+.mat-card-content h6 {
+ overflow: hidden;
+ white-space: nowrap;
+ font-weight: 400;
+ font-size: 1.1rem;
+}
+
+/* Summary adjust for Discover page */
+.small,
+small {
+ font-size: 0.8rem;
+}
+
+@media (min-width: 2000px) {
+ #cardImage {
+ height: 80%;
+ object-fit: cover;
+ display: block;
+ }
+}
+
+.overview {
+ font-size: 1.2em;
+}
\ No newline at end of file
diff --git a/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.ts b/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.ts
new file mode 100644
index 000000000..6e51985ce
--- /dev/null
+++ b/src/Ombi/ClientApp/src/app/discover/components/grid/discover-grid.component.ts
@@ -0,0 +1,134 @@
+import { Component, OnInit, Input } from "@angular/core";
+import { IDiscoverCardResult } from "../../interfaces";
+import { RequestType, ISearchTvResult, ISearchMovieResult, ISearchMovieResultContainer } from "../../../interfaces";
+import { RequestService, SearchV2Service } from "../../../services";
+import { MatDialog } from "@angular/material/dialog";
+import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2";
+import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
+import { EpisodeRequestComponent } from "../../../shared/episode-request/episode-request.component";
+import { MatSnackBar } from "@angular/material/snack-bar";
+import { Router } from "@angular/router";
+
+@Component({
+ selector: "discover-grid",
+ templateUrl: "./discover-grid.component.html",
+ styleUrls: ["./discover-grid.component.scss"],
+})
+export class DiscoverGridComponent implements OnInit {
+
+ @Input() public result: IDiscoverCardResult;
+ public RequestType = RequestType;
+ public requesting: boolean;
+
+ public tv: ISearchTvResultV2;
+ public tvCreator: string;
+ public tvProducer: string;
+ public movie: ISearchMovieResultV2;
+
+ constructor(private searchService: SearchV2Service, private dialog: MatDialog,
+ private requestService: RequestService, private notification: MatSnackBar,
+ private router: Router) { }
+
+ public ngOnInit() {
+ if (this.result.type == RequestType.tvShow) {
+ this.getExtraTvInfo();
+ }
+ if (this.result.type == RequestType.movie) {
+ this.getExtraMovieInfo();
+ }
+ }
+
+ public async getExtraTvInfo() {
+ this.tv = await this.searchService.getTvInfo(this.result.id);
+ this.setTvDefaults(this.tv);
+ this.updateTvItem(this.tv);
+ const creator = this.tv.crew.filter(tv => {
+ return tv.type === "Creator";
+ })[0];
+ if (creator && creator.person) {
+ this.tvCreator = creator.person.name;
+ }
+ const crewResult = this.tv.crew.filter(tv => {
+ return tv.type === "Executive Producer";
+ })[0]
+ if (crewResult && crewResult.person) {
+ this.tvProducer = crewResult.person.name;
+ }
+
+ }
+
+ public openDetails() {
+ if (this.result.type === RequestType.movie) {
+ this.router.navigate(['/details/movie/', this.result.id]);
+ } else if (this.result.type === RequestType.tvShow) {
+ this.router.navigate(['/details/tv/', this.result.id]);
+ }
+ }
+
+ public getStatusClass(): string {
+ if (this.result.available) {
+ return "available";
+ }
+ if (this.result.approved) {
+ return "approved";
+ }
+ if (this.result.requested) {
+ return "requested";
+ }
+ return "notrequested";
+ }
+
+ private getExtraMovieInfo() {
+ // if (!this.result.imdbid) {
+ this.searchService.getFullMovieDetails(this.result.id)
+ .subscribe(m => {
+ this.movie = m;
+ this.updateMovieItem(m);
+ });
+ // }
+ }
+
+ private updateMovieItem(updated: ISearchMovieResultV2) {
+ this.result.url = "http://www.imdb.com/title/" + updated.imdbId + "/";
+ this.result.available = updated.available;
+ this.result.requested = updated.requested;
+ this.result.requested = updated.requestProcessing;
+ this.result.rating = updated.voteAverage;
+ }
+
+
+ private setTvDefaults(x: ISearchTvResultV2) {
+ if (!x.imdbId) {
+ x.imdbId = "https://www.tvmaze.com/shows/" + x.seriesId;
+ } else {
+ x.imdbId = "http://www.imdb.com/title/" + x.imdbId + "/";
+ }
+ }
+
+ private updateTvItem(updated: ISearchTvResultV2) {
+ this.result.title = updated.title;
+ this.result.id = updated.id;
+ this.result.available = updated.fullyAvailable;
+ this.result.posterPath = updated.banner;
+ this.result.requested = updated.requested;
+ this.result.url = updated.imdbId;
+ }
+
+ public async request() {
+ this.requesting = true;
+ if (this.result.type === RequestType.movie) {
+ const result = await this.requestService.requestMovie({ theMovieDbId: this.result.id, languageCode: "" }).toPromise();
+
+ if (result.result) {
+ this.result.requested = true;
+ this.notification.open(result.message, "Ok");
+ } else {
+ this.notification.open(result.errorMessage, "Ok");
+ }
+ } else if (this.result.type === RequestType.tvShow) {
+ this.dialog.open(EpisodeRequestComponent, { width: "700px", data: this.tv, panelClass: 'modal-panel' })
+ }
+ this.requesting = false;
+ }
+
+}
diff --git a/src/Ombi/ClientApp/src/app/discover/components/index.ts b/src/Ombi/ClientApp/src/app/discover/components/index.ts
index 6e56d29d8..e65e48bd3 100644
--- a/src/Ombi/ClientApp/src/app/discover/components/index.ts
+++ b/src/Ombi/ClientApp/src/app/discover/components/index.ts
@@ -7,6 +7,7 @@ import { Routes } from "@angular/router";
import { AuthGuard } from "../../auth/auth.guard";
import { SearchService, RequestService } from "../../services";
import { MatDialog } from "@angular/material/dialog";
+import { DiscoverGridComponent } from "./grid/discover-grid.component";
export const components: any[] = [
@@ -15,6 +16,7 @@ export const components: any[] = [
DiscoverCardDetailsComponent,
DiscoverCollectionsComponent,
DiscoverActorComponent,
+ DiscoverGridComponent,
];
diff --git a/src/Ombi/ClientApp/src/app/discover/discover.module.ts b/src/Ombi/ClientApp/src/app/discover/discover.module.ts
index 31e51fe24..e40cf102a 100644
--- a/src/Ombi/ClientApp/src/app/discover/discover.module.ts
+++ b/src/Ombi/ClientApp/src/app/discover/discover.module.ts
@@ -1,6 +1,7 @@
import { NgModule } from "@angular/core";
import { RouterModule } from "@angular/router";
import { InfiniteScrollModule } from 'ngx-infinite-scroll';
+import {MatButtonToggleModule} from '@angular/material/button-toggle';
import { SharedModule } from "../shared/shared.module";
import { PipeModule } from "../pipes/pipe.module";
@@ -13,6 +14,7 @@ import * as fromComponents from './components';
RouterModule.forChild(fromComponents.routes),
SharedModule,
PipeModule,
+ MatButtonToggleModule,
InfiniteScrollModule,
],
declarations: [
diff --git a/src/Ombi/ClientApp/src/app/discover/interfaces.ts b/src/Ombi/ClientApp/src/app/discover/interfaces.ts
index 9e080ca75..f17cd9768 100644
--- a/src/Ombi/ClientApp/src/app/discover/interfaces.ts
+++ b/src/Ombi/ClientApp/src/app/discover/interfaces.ts
@@ -8,6 +8,7 @@ export interface IDiscoverCardResult {
type: RequestType;
available: boolean;
approved: boolean;
+ denied: boolean;
requested: boolean;
rating: number;
overview: string;
@@ -19,3 +20,8 @@ export enum DiscoverOption {
Movie = 2,
Tv = 3
}
+
+export enum DisplayOption {
+ Card = 1,
+ List = 2
+}
diff --git a/src/Ombi/ClientApp/src/index.html b/src/Ombi/ClientApp/src/index.html
index 40ba6a0eb..f7804c77f 100644
--- a/src/Ombi/ClientApp/src/index.html
+++ b/src/Ombi/ClientApp/src/index.html
@@ -57,7 +57,7 @@
-
+