From 878adc5febf3c8446439fa349a86392d82a282c5 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 31 Dec 2020 23:54:05 +0000 Subject: [PATCH 01/18] poc --- src/Ombi.Core/Engine/RecentlyAddedEngine.cs | 2 + .../discover/discover.component.html | 18 +++- .../discover/discover.component.scss | 5 +- .../components/discover/discover.component.ts | 95 ++++++++++--------- .../src/app/discover/components/index.ts | 2 + .../movie-list/movie-list.component.html | 23 +++++ .../movie-list/movie-list.component.scss | 58 +++++++++++ .../movie-list/movie-list.component.ts | 85 +++++++++++++++++ .../src/app/discover/discover.module.ts | 2 + .../tv-requests-panel.component.html | 2 +- src/Ombi/ClientApp/src/styles/buttons.scss | 8 +- 11 files changed, 247 insertions(+), 53 deletions(-) create mode 100644 src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html create mode 100644 src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.scss create mode 100644 src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts diff --git a/src/Ombi.Core/Engine/RecentlyAddedEngine.cs b/src/Ombi.Core/Engine/RecentlyAddedEngine.cs index 114d32a24..e7491ff39 100644 --- a/src/Ombi.Core/Engine/RecentlyAddedEngine.cs +++ b/src/Ombi.Core/Engine/RecentlyAddedEngine.cs @@ -24,6 +24,8 @@ namespace Ombi.Core.Engine private readonly IEmbyContentRepository _emby; private readonly IRepository _recentlyAddedLog; + + public IEnumerable GetRecentlyAddedMovies(DateTime from, DateTime to) { var plexMovies = _plex.GetAll().Where(x => x.Type == PlexMediaTypeEntity.Movie && x.AddedAt > from && x.AddedAt < to); 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 f105b23ab..f51f73ede 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,5 +1,5 @@
-
+ -
+ + +

Upcoming Movies

+
+ +
+ +

Trending Movies

+
+
-
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss index c2386ae8f..9c11beab7 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss @@ -5,6 +5,7 @@ .small-middle-container { margin: auto; width: 85%; + padding-left:2%; } .small-padding { @@ -35,6 +36,8 @@ ::ng-deep .mat-card-image { height: 75%; + border-radius: 10px; + width: 100%; object-fit: cover; display: block; } @@ -207,4 +210,4 @@ .discover-layout{ display: none; } -} \ No newline at end of file +} 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 c42a0417d..74837f7af 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 @@ -20,6 +20,10 @@ import { DOCUMENT } from "@angular/common"; }) export class DiscoverComponent implements OnInit { + public upcomingMovies: IDiscoverCardResult[] = []; + public trendingMovies: IDiscoverCardResult[] = []; + + public discoverResults: IDiscoverCardResult[] = []; public movies: ISearchMovieResult[] = []; public tvShows: ISearchTvResult[] = []; @@ -45,6 +49,8 @@ export class DiscoverComponent implements OnInit { private mediaTypeStorageKey = "DiscoverOptions"; private displayOptionsKey = "DiscoverDisplayOptions"; + + constructor(private searchService: SearchV2Service, private storageService: StorageService, @Inject(DOCUMENT) private container: Document) { } @@ -52,35 +58,38 @@ export class DiscoverComponent implements OnInit { public async ngOnInit() { this.loading() - const localDiscoverOptions = +this.storageService.get(this.mediaTypeStorageKey); - 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: - this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad); - this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad); - break; - case DiscoverOption.Movie: - this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad); - break; - case DiscoverOption.Tv: - this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad); - break; - } - - this.contentLoaded = this.amountToLoad; - - this.createInitialModel(); - this.scrollDisabled = false; - if (!this.containerHasScrollBar()) { - await this.onScroll(); - } + this.upcomingMovies = this.mapMovieModel(await this.searchService.upcomingMoviesByPage(0, 14)); + this.trendingMovies = this.mapMovieModel(await this.searchService.popularMoviesByPage(0, 14)); +this.finishLoading(); + // const localDiscoverOptions = +this.storageService.get(this.mediaTypeStorageKey); + // 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: + // this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad); + // this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad); + // break; + // case DiscoverOption.Movie: + // this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad); + // break; + // case DiscoverOption.Tv: + // this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad); + // break; + // } + + // this.contentLoaded = this.amountToLoad; + + // this.createInitialModel(); + // this.scrollDisabled = false; + // if (!this.containerHasScrollBar()) { + // await this.onScroll(); + // } } public async onScroll() { @@ -236,18 +245,18 @@ export class DiscoverComponent implements OnInit { private createModel() { const tempResults = []; - switch (this.discoverOptions) { - case DiscoverOption.Combined: - tempResults.push(...this.mapMovieModel()); - tempResults.push(...this.mapTvModel()); - break; - case DiscoverOption.Movie: - tempResults.push(...this.mapMovieModel()); - break; - case DiscoverOption.Tv: - tempResults.push(...this.mapTvModel()); - break; - } + // switch (this.discoverOptions) { + // case DiscoverOption.Combined: + // tempResults.push(...this.mapMovieModel()); + // tempResults.push(...this.mapTvModel()); + // break; + // case DiscoverOption.Movie: + // tempResults.push(...this.mapMovieModel()); + // break; + // case DiscoverOption.Tv: + // tempResults.push(...this.mapTvModel()); + // break; + // } this.shuffle(tempResults); this.discoverResults.push(...tempResults); @@ -255,9 +264,9 @@ export class DiscoverComponent implements OnInit { this.finishLoading(); } - private mapMovieModel(): IDiscoverCardResult[] { + private mapMovieModel(movies: ISearchMovieResult[]): IDiscoverCardResult[] { const tempResults = []; - this.movies.forEach(m => { + movies.forEach(m => { tempResults.push({ available: m.available, posterPath: m.posterPath ? `https://image.tmdb.org/t/p/w500/${m.posterPath}` : "../../../images/default_movie_poster.png", diff --git a/src/Ombi/ClientApp/src/app/discover/components/index.ts b/src/Ombi/ClientApp/src/app/discover/components/index.ts index e65e48bd3..22dd0b208 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/index.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/index.ts @@ -8,6 +8,7 @@ import { AuthGuard } from "../../auth/auth.guard"; import { SearchService, RequestService } from "../../services"; import { MatDialog } from "@angular/material/dialog"; import { DiscoverGridComponent } from "./grid/discover-grid.component"; +import { MovieListComponent } from "./movie-list/movie-list.component"; export const components: any[] = [ @@ -17,6 +18,7 @@ export const components: any[] = [ DiscoverCollectionsComponent, DiscoverActorComponent, DiscoverGridComponent, + MovieListComponent, ]; diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html new file mode 100644 index 000000000..d37f21d0a --- /dev/null +++ b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html @@ -0,0 +1,23 @@ + + +
+
+ {{result.title}} +
{{RequestType[result.type] | humanize}}
+
+
{{result.title}}
+
{{result.overview | truncate: 80}}
+
+
+ +
+
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.scss new file mode 100644 index 000000000..b45393718 --- /dev/null +++ b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.scss @@ -0,0 +1,58 @@ + + +.ombi-card { + padding: 5px; +} +::ng-deep .p-carousel-indicators { + display: none !important; + } + + +.image { + border-radius: 10px; + opacity: 1; + display: block; + width: 100%; + height: auto; + transition: .5s ease; + backface-visibility: hidden; + } + + +.middle { + transition: .5s ease; + opacity: 0; + position: absolute; + top: 75%; + width: 90%; + left: 50%; + transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + } + + + .c { + position: relative; + } + +.c:hover .image { + opacity: 0.3; + } + + .c:hover .middle { + opacity: 1; + } + +.small-text { + font-size: 11px; + } + .title { + font-size: 16px; + } + .top-left { + font-size: 14px; + position: absolute; + top: 8px; + left: 16px; + + } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts new file mode 100644 index 000000000..a58ca6aa6 --- /dev/null +++ b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts @@ -0,0 +1,85 @@ +import { Component, OnInit, Input } from "@angular/core"; +import { IDiscoverCardResult } from "../../interfaces"; +import { RequestType} from "../../../interfaces"; +import { SearchV2Service } from "../../../services"; +import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; +import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2"; + +@Component({ + selector: "movie-list", + templateUrl: "./movie-list.component.html", + styleUrls: ["./movie-list.component.scss"], +}) +export class MovieListComponent implements OnInit { + + public RequestType = RequestType; + @Input() public result: IDiscoverCardResult; + + constructor(private searchService: SearchV2Service) { } + + public ngOnInit() { + if (this.result.type == RequestType.tvShow) { + this.getExtraTvInfo(); + } + if (this.result.type == RequestType.movie) { + this.getExtraMovieInfo(); + } + } + + + public async getExtraTvInfo() { + var result = await this.searchService.getTvInfo(this.result.id); + this.setTvDefaults(result); + this.updateTvItem(result); + + } + + 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.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; + } + +} diff --git a/src/Ombi/ClientApp/src/app/discover/discover.module.ts b/src/Ombi/ClientApp/src/app/discover/discover.module.ts index e40cf102a..19882a5e6 100644 --- a/src/Ombi/ClientApp/src/app/discover/discover.module.ts +++ b/src/Ombi/ClientApp/src/app/discover/discover.module.ts @@ -5,6 +5,7 @@ import {MatButtonToggleModule} from '@angular/material/button-toggle'; import { SharedModule } from "../shared/shared.module"; import { PipeModule } from "../pipes/pipe.module"; +import {CarouselModule} from 'primeng/carousel'; import * as fromComponents from './components'; @@ -14,6 +15,7 @@ import * as fromComponents from './components'; RouterModule.forChild(fromComponents.routes), SharedModule, PipeModule, + CarouselModule, MatButtonToggleModule, InfiniteScrollModule, ], diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html index 661c11e86..b45d9cc7a 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-requests/tv-requests-panel.component.html @@ -50,7 +50,7 @@ -
diff --git a/src/Ombi/ClientApp/src/styles/buttons.scss b/src/Ombi/ClientApp/src/styles/buttons.scss index c9b94cabf..49b98fdee 100644 --- a/src/Ombi/ClientApp/src/styles/buttons.scss +++ b/src/Ombi/ClientApp/src/styles/buttons.scss @@ -5,17 +5,17 @@ $green:#1DE9B6; $orange:#F57C00; .btn-blue { - background-color: $blue; + background-color: $blue !important; } .btn-pink { - background-color: $pink; + background-color: $pink !important; } .btn-green { - background-color: $green; + background-color: $green !important; } .btn-orange { - background-color: $orange; + background-color: $orange !important; } \ No newline at end of file From 1e199b477edea5537b5b7162344cfa0dbbb3426f Mon Sep 17 00:00:00 2001 From: tidusjar Date: Tue, 12 Jan 2021 22:33:19 +0000 Subject: [PATCH 02/18] More work on it... top secret --- src/Ombi/ClientApp/package.json | 2 +- .../card/discover-card-details.component.ts | 2 +- .../card/discover-card.component.html | 25 +- .../card/discover-card.component.scss | 76 +++++- .../card/discover-card.component.ts | 57 ++++- .../discover/discover.component.html | 16 +- .../discover/discover.component.scss | 216 +----------------- .../components/discover/discover.component.ts | 7 +- .../movie-list/movie-list.component.html | 22 +- .../movie-list/movie-list.component.ts | 95 +++----- .../src/app/discover/discover.module.ts | 4 +- src/Ombi/ClientApp/yarn.lock | 14 +- 12 files changed, 204 insertions(+), 332 deletions(-) diff --git a/src/Ombi/ClientApp/package.json b/src/Ombi/ClientApp/package.json index 82c946672..8f1e6384a 100644 --- a/src/Ombi/ClientApp/package.json +++ b/src/Ombi/ClientApp/package.json @@ -52,7 +52,7 @@ "please-wait": "^0.0.5", "popper.js": "^1.14.3", "primeicons": "^4.0.0", - "primeng": "^10.0.3", + "primeng": "^11.0.0", "rxjs": "^6.5.2", "spinkit": "^1.2.5", "store": "^2.0.12", diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.ts b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.ts index 883add54a..804e0e9ec 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.ts @@ -77,7 +77,7 @@ export class DiscoverCardDetailsComponent implements OnInit { this.messageService.send(result.errorMessage, "Ok"); } } else if (this.data.type === RequestType.tvShow) { - this.dialog.open(EpisodeRequestComponent, { width: "700px", data: this.tv, panelClass: 'modal-panel' }) + this.dialog.open(EpisodeRequestComponent, { width: "700px", data: {series: this.tv }, panelClass: 'modal-panel' }) } this.loading = false; diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html index b32bb98d8..cb4fcb23b 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html @@ -1,4 +1,4 @@ -
+ + + + +
+
+ + {{result.title}} +
{{RequestType[result.type] | humanize}}
+
+
{{result.title}}
+
{{result.overview}}
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss index 5f232a48e..18da6486b 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss @@ -2,7 +2,7 @@ $ombi-primary:#3f3f3f; $card-background: #2b2b2b; #cardImage { - border-radius: 5px 5px 0px 0px; + border-radius: 5px; height: 75%; } @@ -166,4 +166,76 @@ small { } .ribbon-icon { transform: translateX(0%) translateY(0%) rotate(-45deg); - } \ No newline at end of file + } + + + + +.ombi-card { + padding: 5px; +} +::ng-deep .p-carousel-indicators { + display: none !important; + } + + +.image { + border-radius: 10px; + opacity: 1; + display: block; + width: 100%; + height: auto; + transition: .5s ease; + backface-visibility: hidden; +} + + +.middle { + transition: .5s ease; + opacity: 0; + position: absolute; + top: 67%; + width: 90%; + left: 50%; + transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); +} + + +.c { + position: relative; +} + +.c:hover .image { + opacity: 0.3; +} + +.c:hover .middle { + opacity: 1; +} + +.small-text { + font-size: 11px; +} +.title { + font-size: 18px; + } + .top-left { + font-size: 14px; + position: absolute; + text-transform: uppercase; + top: 8px; + left: 16px; + + } + .full-width { + width: 100%; + } + + .ellipsis { + display: -webkit-box; + -webkit-line-clamp: 6; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + } diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts index 6512ca3a8..4dd357a89 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts @@ -1,11 +1,12 @@ import { Component, OnInit, Input } from "@angular/core"; import { IDiscoverCardResult } from "../../interfaces"; import { RequestType } from "../../../interfaces"; -import { SearchService, SearchV2Service } from "../../../services"; +import { MessageService, RequestService, SearchV2Service } from "../../../services"; import { MatDialog } from "@angular/material/dialog"; import { DiscoverCardDetailsComponent } from "./discover-card-details.component"; import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2"; +import { EpisodeRequestComponent } from "../../../shared/episode-request/episode-request.component"; @Component({ selector: "discover-card", @@ -17,8 +18,14 @@ export class DiscoverCardComponent implements OnInit { @Input() public result: IDiscoverCardResult; public RequestType = RequestType; public hide: boolean; + public fullyLoaded = false; + public loading: boolean; - constructor(private searchService: SearchV2Service, private v1Search: SearchService, private dialog: MatDialog) { } + // This data is needed to open the dialog + private tvSearchResult: ISearchTvResultV2; + + constructor(private searchService: SearchV2Service, private dialog: MatDialog, private requestService: RequestService, + public messageService: MessageService) { } public ngOnInit() { if (this.result.type == RequestType.tvShow) { @@ -38,16 +45,16 @@ export class DiscoverCardComponent implements OnInit { public async getExtraTvInfo() { if (this.result.tvMovieDb) { - var result = await this.searchService.getTvInfoWithMovieDbId(+this.result.id); + this.tvSearchResult = await this.searchService.getTvInfoWithMovieDbId(+this.result.id); } else { - var result = await this.searchService.getTvInfo(+this.result.id); + this.tvSearchResult = await this.searchService.getTvInfo(+this.result.id); } - if(result.status === "404") { + if (this.tvSearchResult.status === "404") { this.hide = true; return; } - this.setTvDefaults(result); - this.updateTvItem(result); + this.setTvDefaults(this.tvSearchResult); + this.updateTvItem(this.tvSearchResult); } @@ -55,10 +62,13 @@ export class DiscoverCardComponent implements OnInit { this.searchService.getArtistInformation(this.result.id.toString()).subscribe(x => { if (x.poster) { this.result.posterPath = x.poster; + this.fullyLoaded = true; } else { this.searchService.getReleaseGroupArt(this.result.id.toString()).subscribe(art => { - if(art.image) { + if (art.image) { this.result.posterPath = art.image; + + this.fullyLoaded = true; } }) } @@ -68,8 +78,7 @@ export class DiscoverCardComponent implements OnInit { } public generateDetailsLink(): string { - let link = ""; - switch(this.result.type){ + switch (this.result.type) { case RequestType.movie: return `/details/movie/${this.result.id}`; case RequestType.tvShow: @@ -105,12 +114,36 @@ export class DiscoverCardComponent implements OnInit { return ""; } + public request(event: any) { + event.preventDefault(); + this.loading = true; + switch (this.result.type) { + case RequestType.tvShow: + const dia = this.dialog.open(EpisodeRequestComponent, { width: "700px", data: { series: this.tvSearchResult }, panelClass: 'modal-panel' }); + dia.afterClosed().subscribe(x => this.loading = false); + return; + case RequestType.movie: + this.requestService.requestMovie({ theMovieDbId: +this.result.id, languageCode: null, requestOnBehalf: null }).subscribe(x => { + if (x.result) { + this.result.requested = true; + this.messageService.send(x.message, "Ok"); + } else { + this.messageService.send(x.errorMessage, "Ok"); + } + this.loading = false; + }); + return; + } + } + private getExtraMovieInfo() { if (!this.result.imdbid) { this.searchService.getFullMovieDetails(+this.result.id) .subscribe(m => { this.updateMovieItem(m); }); + } else { + this.fullyLoaded = true; } } @@ -122,6 +155,8 @@ export class DiscoverCardComponent implements OnInit { this.result.rating = updated.voteAverage; this.result.overview = updated.overview; this.result.imdbid = updated.imdbId; + + this.fullyLoaded = true; } @@ -142,6 +177,8 @@ export class DiscoverCardComponent implements OnInit { this.result.url = updated.imdbId; this.result.overview = updated.overview; this.result.approved = updated.approved; + + this.fullyLoaded = 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 f51f73ede..22be3d83a 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 @@ -40,13 +40,17 @@
--> -

Upcoming Movies

-
- +
+

Popular

+
+ +
-

Trending Movies

-
- +
+

Trending

+
+ +
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss index 9c11beab7..76e1ce26c 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss @@ -1,213 +1,3 @@ -.full-height { - height: 100%; -} - -.small-middle-container { - margin: auto; - width: 85%; - padding-left:2%; -} - -.small-padding { - padding-left: 20px; - padding-right: 20px; - margin-bottom: 28px; -} - -.loading-spinner { - margin: 10%; -} - -#scroller { - height: 100vh; - overflow: scroll; -} - -.small-space { - padding-top: 1%; -} - -.discover-layout { - position: absolute; - float: right; - margin-right: 36px; - z-index: 1; -} - -::ng-deep .mat-card-image { - height: 75%; - border-radius: 10px; - width: 100%; - object-fit: cover; - display: block; -} - -.card-spacing { - height: 100%; -} - -.mat-card-content h6 { - overflow: hidden; - white-space: nowrap; - font-weight: 500; - font-size: 1.1rem; -} - -@media (min-width: 300px) { - - .small-middle-container { - margin: inherit; - } - - .col-xl-2 { - flex: 0 0 100%; - max-width: 100%; - min-width: 100%; - } - - .btn-group { - width: 100%; - } - - mat-button-base { - width: 100%; - } - - .col { - padding-right: 10px !important; - padding-left: 10px !important; - } - - .row { - margin-left: 0px; - } - - .small-padding { - padding-left: 5px !important; - padding-right: 0px !important; - height: 40em; - } - - ::ng-deep .mat-card-image { - height: 85% !important; - } -} - -@media (min-width: 600px) { - .justify-content-md-center { - justify-content: center !important; - } - - .small-middle-container { - width: auto; - } - - .btn-group { - width: auto; - } - - mat-button-base { - width: auto; - } - - ::ng-deep .mat-card-image { - height: 75% !important; - } -} - -@media (min-width: 660px) { - .col-xl-2 { - flex: 0 0 50%; - max-width: 50%; - min-width: 50%; - } - - .col { - padding-right: 15px !important; - padding-left: 15px !important; - } - - .small-padding { - padding-left: 20px !important; - padding-right: 20px !important; - height: auto; - } - - .row { - margin-left: 0px; - } - - .small-middle-container { - width: auto; - overflow: hidden; - } - - .btn-group { - width: auto; - } - - mat-button-base { - width: auto; - } -} - -@media (min-width: 870px) { - .col-xl-2 { - flex: 0 0 33.33333%; - max-width: 33.33333%; - min-width: 33.33333%; - } -} - -@media (min-width: 1100px) { - .col-xl-2 { - flex: 0 0 20%; - max-width: 25%; - min-width: 25%; - } -} - -@media (min-width: 1300px) { - .col-xl-2 { - flex: 0 0 18%; - max-width: 20%; - min-width: 20%; - } -} - -@media (min-width: 1600px) { - .col-xl-2 { - flex: 0 0 16.66666667%; - max-width: 16.66666667%; - min-width: 16.66666667%; - } -} - -@media (min-width: 1900px) { - .col-xl-2 { - flex: 0 0 14.285713%; - max-width: 14.285713%; - min-width: 14.285713%; - } -} - -@media (min-width: 2200px) { - .col-xl-2 { - flex: 0 0 12.5%; - max-width: 12.5%; - min-width: 12.5%; - } -} - -@media (min-width: 2500px) { - .col-xl-2 { - flex: 0 0 11.111111%; - max-width: 11.111111%; - min-width: 11.111111%; - } -} -@media (max-width: 420px) { - .discover-layout{ - display: none; - } -} +.section { + margin: 20px; +} \ No newline at end of file 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 6939c51ee..519126715 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 @@ -5,6 +5,7 @@ import { IDiscoverCardResult, DiscoverOption, DisplayOption } from "../../interf import { trigger, transition, style, animate } from "@angular/animations"; import { StorageService } from "../../../shared/storage/storage-service"; import { DOCUMENT } from "@angular/common"; +import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; @Component({ templateUrl: "./discover.component.html", @@ -58,7 +59,7 @@ export class DiscoverComponent implements OnInit { public async ngOnInit() { this.loading() - this.upcomingMovies = this.mapMovieModel(await this.searchService.upcomingMoviesByPage(0, 14)); + this.upcomingMovies = this.mapTvModel(await this.searchService.popularTvByPage(0, 14)); this.trendingMovies = this.mapMovieModel(await this.searchService.popularMoviesByPage(0, 14)); this.finishLoading(); // const localDiscoverOptions = +this.storageService.get(this.mediaTypeStorageKey); @@ -286,9 +287,9 @@ this.finishLoading(); return tempResults; } - private mapTvModel(): IDiscoverCardResult[] { + private mapTvModel(tv: ISearchTvResult[]): IDiscoverCardResult[] { const tempResults = []; - this.tvShows.forEach(m => { + tv.forEach(m => { tempResults.push({ available: m.available, posterPath: "../../../images/default_tv_poster.png", diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html index d37f21d0a..908fc941b 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html @@ -1,23 +1,5 @@ - + -
-
- {{result.title}} -
{{RequestType[result.type] | humanize}}
-
-
{{result.title}}
-
{{result.overview | truncate: 80}}
-
-
- -
-
- -
-
-
-
-
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts index a58ca6aa6..f8a9ef03b 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts @@ -10,76 +10,37 @@ import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2"; templateUrl: "./movie-list.component.html", styleUrls: ["./movie-list.component.scss"], }) -export class MovieListComponent implements OnInit { +export class MovieListComponent { public RequestType = RequestType; - @Input() public result: IDiscoverCardResult; - - constructor(private searchService: SearchV2Service) { } - - public ngOnInit() { - if (this.result.type == RequestType.tvShow) { - this.getExtraTvInfo(); - } - if (this.result.type == RequestType.movie) { - this.getExtraMovieInfo(); - } - } - - - public async getExtraTvInfo() { - var result = await this.searchService.getTvInfo(this.result.id); - this.setTvDefaults(result); - this.updateTvItem(result); - - } - - public getStatusClass(): string { - if (this.result.available) { - return "available"; - } - if (this.result.approved) { - return "approved"; - } - if (this.result.requested) { - return "requested"; - } - return "notrequested"; + @Input() public result: IDiscoverCardResult[]; + + public responsiveOptions: any; + + constructor() { + this.responsiveOptions = [ + { + breakpoint: '2559px', + numVisible: 7, + numScroll: 7 + }, + { + breakpoint: '1024px', + numVisible: 4, + numScroll: 4 + }, + { + breakpoint: '768px', + numVisible: 2, + numScroll: 2 + }, + { + breakpoint: '560px', + numVisible: 1, + numScroll: 1 + } + ]; } - private getExtraMovieInfo() { - if (!this.result.imdbid) { - this.searchService.getFullMovieDetails(this.result.id) - .subscribe(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; - } } diff --git a/src/Ombi/ClientApp/src/app/discover/discover.module.ts b/src/Ombi/ClientApp/src/app/discover/discover.module.ts index 19882a5e6..931a0861b 100644 --- a/src/Ombi/ClientApp/src/app/discover/discover.module.ts +++ b/src/Ombi/ClientApp/src/app/discover/discover.module.ts @@ -5,7 +5,8 @@ import {MatButtonToggleModule} from '@angular/material/button-toggle'; import { SharedModule } from "../shared/shared.module"; import { PipeModule } from "../pipes/pipe.module"; -import {CarouselModule} from 'primeng/carousel'; +import { CarouselModule } from 'primeng/carousel'; +import { SkeletonModule } from 'primeng/skeleton'; import * as fromComponents from './components'; @@ -18,6 +19,7 @@ import * as fromComponents from './components'; CarouselModule, MatButtonToggleModule, InfiniteScrollModule, + SkeletonModule, ], declarations: [ ...fromComponents.components diff --git a/src/Ombi/ClientApp/yarn.lock b/src/Ombi/ClientApp/yarn.lock index 8c55c594b..8ab0789e1 100644 --- a/src/Ombi/ClientApp/yarn.lock +++ b/src/Ombi/ClientApp/yarn.lock @@ -7005,10 +7005,10 @@ primeicons@^4.0.0: resolved "https://registry.yarnpkg.com/primeicons/-/primeicons-4.0.0.tgz#a3594b3af213dcf8c4c3d6fc99eea05b7c92f57c" integrity sha512-JQBIswGSItn8I0Pq21RchENpKJxSi1MjfBDfggMQpXtoKNKblJoHmol/7tCV3CAV2Dlb94ht8TD8qdIAW01pGg== -primeng@^10.0.3: - version "10.0.3" - resolved "https://registry.yarnpkg.com/primeng/-/primeng-10.0.3.tgz#e9d0ea425b9c5023bc9eef2cb014941939d0c35e" - integrity sha512-Nsiwpmy3RlFPBlxabdzeAYxFn4fXEyZjj7iAi1X5J4RRGD7NoB67+NbnOInE1rXTnNVHYxCca91OvaNiHSWWrg== +primeng@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/primeng/-/primeng-11.1.0.tgz#3957e6bac5bf4cc5e4eb4dc2761a35668e08a780" + integrity sha512-5eQvLbUJeyaa5EwIEQobRhyl92EhNo4jxvh4YGh984t0B8SyuGmWH5TjoM5GmiZeYOBlt8htvHFJ3rz3xKXQFA== dependencies: tslib "^2.0.0" @@ -8767,9 +8767,9 @@ tslib@^1.8.0, tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" tslib@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.3.tgz#8e0741ac45fc0c226e58a17bfc3e64b9bc6ca61c" - integrity sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ== + version "2.1.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" + integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== tslint-angular@^1.1.2: version "1.1.2" From 0345fa3a6d6b4197bd79a49df4953a23ade82701 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 14 Jan 2021 22:49:24 +0000 Subject: [PATCH 03/18] Super top secret stuff... Stop looking, I will find out --- .../card/discover-card.component.html | 7 +- .../card/discover-card.component.scss | 2 +- .../card/discover-card.component.ts | 5 +- .../carousel-list.component.html | 20 ++ .../carousel-list.component.scss} | 32 +-- .../carousel-list/carousel-list.component.ts | 218 ++++++++++++++++++ .../discover/discover.component.html | 21 +- .../discover/discover.component.scss | 6 +- .../components/discover/discover.component.ts | 6 +- .../src/app/discover/components/index.ts | 4 +- .../movie-list/movie-list.component.html | 5 - .../movie-list/movie-list.component.ts | 46 ---- .../ClientApp/src/styles/new-mat-palette.scss | 98 ++++++++ 13 files changed, 389 insertions(+), 81 deletions(-) create mode 100644 src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html rename src/Ombi/ClientApp/src/app/discover/components/{movie-list/movie-list.component.scss => carousel-list/carousel-list.component.scss} (73%) create mode 100644 src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts delete mode 100644 src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html delete mode 100644 src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts create mode 100644 src/Ombi/ClientApp/src/styles/new-mat-palette.scss diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html index cb4fcb23b..bd1a9cf90 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.html @@ -17,11 +17,10 @@
--> - +
-
+ \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss index 18da6486b..92b940a08 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss @@ -3,7 +3,7 @@ $card-background: #2b2b2b; #cardImage { border-radius: 5px; - height: 75%; + height: 315px; } .dark-card { diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts index 4dd357a89..2b073d874 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts @@ -49,7 +49,7 @@ export class DiscoverCardComponent implements OnInit { } else { this.tvSearchResult = await this.searchService.getTvInfo(+this.result.id); } - if (this.tvSearchResult.status === "404") { + if (this.tvSearchResult?.status.length > 0 && this.tvSearchResult?.status === "404") { this.hide = true; return; } @@ -161,6 +161,9 @@ export class DiscoverCardComponent implements OnInit { private setTvDefaults(x: ISearchTvResultV2) { + if(!x) { + this.hide = true; + } if (x.imdbId) { x.imdbId = "http://www.imdb.com/title/" + x.imdbId + "/"; } else { diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html new file mode 100644 index 000000000..0f2284b87 --- /dev/null +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html @@ -0,0 +1,20 @@ +
+ + {{'Discovery.Combined' | translate}} + {{'Discovery.Movies' | translate}} + {{'Discovery.Tv' | translate}} + +
+ + + + + + +
+ + + + + +
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss similarity index 73% rename from src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.scss rename to src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss index b45393718..4fa0b756b 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss @@ -4,8 +4,8 @@ padding: 5px; } ::ng-deep .p-carousel-indicators { - display: none !important; - } + display: none !important; + } .image { @@ -44,15 +44,19 @@ } .small-text { - font-size: 11px; - } - .title { - font-size: 16px; - } - .top-left { - font-size: 14px; - position: absolute; - top: 8px; - left: 16px; - - } \ No newline at end of file + font-size: 11px; +} +.title { + font-size: 16px; +} +.top-left { + font-size: 14px; + position: absolute; + top: 8px; + left: 16px; +} + + +.right { + text-align: right; +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts new file mode 100644 index 000000000..ee12dbfc5 --- /dev/null +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.ts @@ -0,0 +1,218 @@ +import { Component, OnInit, Input } from "@angular/core"; +import { DiscoverOption, IDiscoverCardResult } from "../../interfaces"; +import { ISearchMovieResult, ISearchTvResult, RequestType } from "../../../interfaces"; +import { SearchV2Service } from "../../../services"; +import { StorageService } from "../../../shared/storage/storage-service"; + +export enum DiscoverType { + Upcoming, + Trending, + Popular, +} + +@Component({ + selector: "carousel-list", + templateUrl: "./carousel-list.component.html", + styleUrls: ["./carousel-list.component.scss"], +}) +export class CarouselListComponent implements OnInit { + + @Input() public discoverType: DiscoverType; + + public DiscoverOption = DiscoverOption; + public discoverOptions: DiscoverOption = DiscoverOption.Combined; + public discoverResults: IDiscoverCardResult[] = []; + public movies: ISearchMovieResult[] = []; + public tvShows: ISearchTvResult[] = []; + public responsiveOptions: any; + public RequestType = RequestType; + public loadingFlag: boolean; + + get mediaTypeStorageKey() { + return "DiscoverOptions" + this.discoverType.toString(); + }; + private amountToLoad = 14; + + constructor(private searchService: SearchV2Service, + private storageService: StorageService) { + this.responsiveOptions = [ + { + breakpoint: '2559px', + numVisible: 7, + numScroll: 7 + }, + { + breakpoint: '1024px', + numVisible: 4, + numScroll: 4 + }, + { + breakpoint: '768px', + numVisible: 2, + numScroll: 2 + }, + { + breakpoint: '560px', + numVisible: 1, + numScroll: 1 + } + ]; + } + + public async ngOnInit() { + const localDiscoverOptions = +this.storageService.get(this.mediaTypeStorageKey); + if (localDiscoverOptions) { + this.discoverOptions = DiscoverOption[DiscoverOption[localDiscoverOptions]]; + } + + var moviePromise: Promise; + var tvPromise: Promise; + switch (this.discoverOptions) { + case DiscoverOption.Combined: + moviePromise = this.loadMovies(); + tvPromise = this.loadTv(); + break; + case DiscoverOption.Movie: + moviePromise = this.loadMovies(); + break; + case DiscoverOption.Tv: + tvPromise = this.loadTv(); + break; + } + + await moviePromise; + await tvPromise; + + this.createInitialModel(); + } + + public async switchDiscoverMode(newMode: DiscoverOption) { + this.loading(); + this.clear(); + this.discoverOptions = newMode; + this.storageService.save(this.mediaTypeStorageKey, newMode.toString()); + await this.ngOnInit(); + this.finishLoading(); + } + + private async loadMovies() { + switch (this.discoverType) { + case DiscoverType.Popular: + this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad); + break; + case DiscoverType.Trending: + this.movies = await this.searchService.nowPlayingMoviesByPage(0, this.amountToLoad); + break; + case DiscoverType.Upcoming: + this.movies = await this.searchService.upcomingMoviesByPage(0, this.amountToLoad); + break + } + } + + private async loadTv() { + switch (this.discoverType) { + case DiscoverType.Popular: + this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad); + break; + case DiscoverType.Trending: + this.tvShows = await this.searchService.trendingTvByPage(0, this.amountToLoad); + break; + case DiscoverType.Upcoming: + this.tvShows = await this.searchService.anticipatedTvByPage(0, this.amountToLoad); + break + } + } + + private createInitialModel() { + this.clear(); + this.createModel(); + } + + private createModel() { + const tempResults = []; + + switch (this.discoverOptions) { + case DiscoverOption.Combined: + tempResults.push(...this.mapMovieModel()); + tempResults.push(...this.mapTvModel()); + this.shuffle(tempResults); + break; + case DiscoverOption.Movie: + tempResults.push(...this.mapMovieModel()); + break; + case DiscoverOption.Tv: + tempResults.push(...this.mapTvModel()); + break; + } + + this.discoverResults.push(...tempResults); + + this.finishLoading(); + } + + private mapMovieModel(): IDiscoverCardResult[] { + const tempResults = []; + this.movies.forEach(m => { + tempResults.push({ + available: m.available, + posterPath: m.posterPath ? `https://image.tmdb.org/t/p/w500/${m.posterPath}` : "../../../images/default_movie_poster.png", + requested: m.requested, + title: m.title, + type: RequestType.movie, + id: m.id, + url: `http://www.imdb.com/title/${m.imdbId}/`, + rating: m.voteAverage, + overview: m.overview, + approved: m.approved, + imdbid: m.imdbId, + denied: false, + background: m.backdropPath + }); + }); + return tempResults; + } + + private mapTvModel(): IDiscoverCardResult[] { + const tempResults = []; + this.tvShows.forEach(m => { + tempResults.push({ + available: m.available, + posterPath: "../../../images/default_tv_poster.png", + requested: m.requested, + title: m.title, + type: RequestType.tvShow, + id: m.id, + url: undefined, + rating: +m.rating, + overview: m.overview, + approved: m.approved || m.partlyAvailable, + imdbid: m.imdbId, + denied: false, + background: m.background + }); + }); + return tempResults; + } + + private clear() { + this.discoverResults = []; + } + + private shuffle(discover: IDiscoverCardResult[]): IDiscoverCardResult[] { + for (let i = discover.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [discover[i], discover[j]] = [discover[j], discover[i]]; + } + return discover; + } + + private loading() { + this.loadingFlag = true; + } + + private finishLoading() { + this.loadingFlag = false; + } + + +} 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 22be3d83a..8617e340c 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 @@ -39,18 +39,29 @@
--> - +
+

Popular

-
- +
+
+

Trending

-
- +
+ +
+ +
+ +
+

Upcoming

+
+
+
\ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss index 76e1ce26c..c1add14c9 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss @@ -1,3 +1,7 @@ .section { margin: 20px; -} \ No newline at end of file +} +::ng-deep .p-carousel-indicators { + display: none !important; + } + \ No newline at end of file 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 519126715..7b4fc291b 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 @@ -6,6 +6,7 @@ import { trigger, transition, style, animate } from "@angular/animations"; import { StorageService } from "../../../shared/storage/storage-service"; import { DOCUMENT } from "@angular/common"; import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; +import { DiscoverType } from "../carousel-list/carousel-list.component"; @Component({ templateUrl: "./discover.component.html", @@ -30,6 +31,7 @@ export class DiscoverComponent implements OnInit { public tvShows: ISearchTvResult[] = []; public discoverOptions: DiscoverOption = DiscoverOption.Combined; + public DiscoverType = DiscoverType; public DiscoverOption = DiscoverOption; public displayOption: DisplayOption = DisplayOption.Card; public DisplayOption = DisplayOption; @@ -59,8 +61,8 @@ export class DiscoverComponent implements OnInit { public async ngOnInit() { this.loading() - this.upcomingMovies = this.mapTvModel(await this.searchService.popularTvByPage(0, 14)); - this.trendingMovies = this.mapMovieModel(await this.searchService.popularMoviesByPage(0, 14)); + // this.upcomingMovies = this.mapTvModel(await this.searchService.popularTvByPage(0, 14)); + // this.trendingMovies = this.mapMovieModel(await this.searchService.popularMoviesByPage(0, 14)); this.finishLoading(); // const localDiscoverOptions = +this.storageService.get(this.mediaTypeStorageKey); // if (localDiscoverOptions) { diff --git a/src/Ombi/ClientApp/src/app/discover/components/index.ts b/src/Ombi/ClientApp/src/app/discover/components/index.ts index b26ed5b19..c0f3a7141 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/index.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/index.ts @@ -8,8 +8,8 @@ import { AuthGuard } from "../../auth/auth.guard"; import { SearchService, RequestService } from "../../services"; import { MatDialog } from "@angular/material/dialog"; import { DiscoverGridComponent } from "./grid/discover-grid.component"; -import { MovieListComponent } from "./movie-list/movie-list.component"; import { DiscoverSearchResultsComponent } from "./search-results/search-results.component"; +import { CarouselListComponent } from "./carousel-list/carousel-list.component"; export const components: any[] = [ @@ -20,7 +20,7 @@ export const components: any[] = [ DiscoverActorComponent, DiscoverGridComponent, DiscoverSearchResultsComponent, - MovieListComponent, + CarouselListComponent, ]; diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html deleted file mode 100644 index 908fc941b..000000000 --- a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.html +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts b/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts deleted file mode 100644 index f8a9ef03b..000000000 --- a/src/Ombi/ClientApp/src/app/discover/components/movie-list/movie-list.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component, OnInit, Input } from "@angular/core"; -import { IDiscoverCardResult } from "../../interfaces"; -import { RequestType} from "../../../interfaces"; -import { SearchV2Service } from "../../../services"; -import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; -import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2"; - -@Component({ - selector: "movie-list", - templateUrl: "./movie-list.component.html", - styleUrls: ["./movie-list.component.scss"], -}) -export class MovieListComponent { - - public RequestType = RequestType; - @Input() public result: IDiscoverCardResult[]; - - public responsiveOptions: any; - - constructor() { - this.responsiveOptions = [ - { - breakpoint: '2559px', - numVisible: 7, - numScroll: 7 - }, - { - breakpoint: '1024px', - numVisible: 4, - numScroll: 4 - }, - { - breakpoint: '768px', - numVisible: 2, - numScroll: 2 - }, - { - breakpoint: '560px', - numVisible: 1, - numScroll: 1 - } - ]; - } - - -} diff --git a/src/Ombi/ClientApp/src/styles/new-mat-palette.scss b/src/Ombi/ClientApp/src/styles/new-mat-palette.scss new file mode 100644 index 000000000..9d9872775 --- /dev/null +++ b/src/Ombi/ClientApp/src/styles/new-mat-palette.scss @@ -0,0 +1,98 @@ +$ombi-accent: ( + 50: #ecfafe, + 100: #d0f2fe, + 200: #b1e9fd, + 300: #91e0fc, + 400: #7ad9fb, + 500: #62d2fa, + 600: #5acdf9, + 700: #50c7f9, + 800: #46c1f8, + 900: #34b6f6, + A100: #ffffff, + A200: #ffffff, + A400: #d6f1ff, + A700: #bde8ff, + contrast: ( + 50 : #000000, + 100 : #000000, + 200 : #000000, + 300 : #000000, + 400 : #ffffff, + 500 : #ffffff, + 600 : #ffffff, + 700 : #ffffff, + 800 : #ffffff, + 900 : #ffffff, + A100 : #000000, + A200 : #000000, + A400 : #000000, + A700 : #000000, + ) +); + +$ombi-primary: ( + 50 : #e4e5e6, + 100 : #bbbdc1, + 200 : #8d9297, + 300 : #5f666d, + 400 : #3d454e, + 500 : #1b242f, + 600 : #18202a, + 700 : #141b23, + 800 : #10161d, + 900 : #080d12, + A100 : #55aaff, + A200 : #2290ff, + A400 : #0077ee, + A700 : #006ad4, + contrast: ( + 50 : #000000, + 100 : #000000, + 200 : #000000, + 300 : #ffffff, + 400 : #ffffff, + 500 : #ffffff, + 600 : #ffffff, + 700 : #ffffff, + 800 : #ffffff, + 900 : #ffffff, + A100 : #000000, + A200 : #ffffff, + A400 : #ffffff, + A700 : #ffffff, + ) +); + +$ombi-background: ( + 50 : #e2e3e4, + 100 : #b7b9bb, + 200 : #878b8e, + 300 : #575d61, + 400 : #333a3f, + 500 : #0f171d, + 600 : #0d141a, + 700 : #0b1115, + 800 : #080d11, + 900 : #04070a, + A100 : #4fc4ff, + A200 : #1cb3ff, + A400 : #009be8, + A700 : #008ace, + contrast: ( + 50 : #000000, + 100 : #000000, + 200 : #000000, + 300 : #ffffff, + 400 : #ffffff, + 500 : #ffffff, + 600 : #ffffff, + 700 : #ffffff, + 800 : #ffffff, + 900 : #ffffff, + A100 : #000000, + A200 : #000000, + A400 : #ffffff, + A700 : #ffffff, + ) +); \ No newline at end of file From 0a5e6358544ab08c8321a5da1a3938d75ad5aec7 Mon Sep 17 00:00:00 2001 From: twanariens Date: Fri, 15 Jan 2021 02:25:28 +0100 Subject: [PATCH 04/18] These are not the commits you are looking for. --- .../card/discover-card-details.component.scss | 2 +- .../card/discover-card.component.scss | 6 +- .../carousel-list.component.html | 8 +-- .../carousel-list.component.scss | 25 +++++++ .../discover/discover.component.scss | 7 +- .../src/app/my-nav/my-nav.component.html | 10 +-- .../src/app/my-nav/my-nav.component.scss | 69 ++++++++++++++++--- src/Ombi/ClientApp/src/styles/shared.scss | 4 +- 8 files changed, 108 insertions(+), 23 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.scss b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.scss index 27079acbf..e7fe00c60 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card-details.component.scss @@ -42,4 +42,4 @@ h3 strong { .overview { height:300px; overflow-y: auto; -} +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss index 92b940a08..03fc37187 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.scss @@ -61,8 +61,12 @@ small { } @media (min-width: 2000px) { + .ombi-card{ + height:100%; + } + #cardImage { - height: 80%; + height: 100%; object-fit: cover; display: block; } diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html index 0f2284b87..224a43be2 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.html @@ -1,8 +1,8 @@
- - {{'Discovery.Combined' | translate}} - {{'Discovery.Movies' | translate}} - {{'Discovery.Tv' | translate}} + + {{'Discovery.Combined' | translate}} + {{'Discovery.Movies' | translate}} + {{'Discovery.Tv' | translate}}
diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss index 4fa0b756b..d640fbe8e 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss @@ -59,4 +59,29 @@ .right { text-align: right; + margin-top:-61px; +} + +.discover-filter-buttons-group { + background: #0f171d; + border: 1px solid #35465c; + border-radius: 30px; + color:#fff; + margin-bottom:10px; + + .discover-filter-button{ + background:inherit; + color:inherit; + padding:0 20px; + border-radius: 30px; + margin:5px; + } + + .discover-filter-button.cdk-focused{ + background:#62d2fa; + } + + .discover-filter-button .mat-button-toggle-button:focus{ + outline:none; + } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss index c1add14c9..d95586507 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.scss @@ -4,4 +4,9 @@ ::ng-deep .p-carousel-indicators { display: none !important; } - \ No newline at end of file + +h2{ + margin-top:40px; + margin-left:40px; + font-size: 24px; +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html index 4a212ef8e..ff54f9241 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html @@ -3,7 +3,7 @@ [attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'" [mode]="(isHandset$ | async) ? 'over' : 'side'" [opened]="!(isHandset$ | async)"> - {{applicationName}} + {{applicationName}}
@@ -65,14 +65,14 @@
- - + + -
+ -
+
diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss index b8abd28dc..d0f1bdcc9 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss @@ -5,10 +5,6 @@ overflow:auto; } -.sidenav { - width: 220px; -} - .sidenav .mat-toolbar { background: inherit; } @@ -44,11 +40,6 @@ padding: 0px 5px; } -.active-list-item { - background: $accent !important; - color:white; -} - ::ng-deep .dark .active-list-item { background: $accent-dark !important; color:black !important; @@ -119,4 +110,64 @@ bottom: 0; left: 0; text-align: center; +} +// New CSS for new style // + +.sidenav-container .sidenav{ + background: #1b242f; + color:#FFF; + width: 23rem; + font-family: 'Montserrat', sans-serif; + + .application-name{ + font-family: 'Montserrat', sans-serif; + text-transform: uppercase; + color:#62d2fa; + align-items:center; + justify-content: center; + font-weight: 700; + font-size:24px; + padding:40px 20px; + height:auto; + } + + .outer-profile { + background: inherit; + box-shadow:none; + } + + .mat-list-item{ + color:#FFF; + font-family:Roboto, sans-serif; + font-size: 14px; + font-weight: 400; + padding:10px 20px; + height:auto; + width:20rem; + margin-bottom:1rem; + } + + .active-list-item{ + color:#1b242f; + background: #62d2fa; + border-radius:0px 30px 30px 0px; + padding:10px 20px; + height:auto; + width:20rem; + } +} + +.outer-profile .profile-img-container { + background: inherit; +} + +.content-container{ + background: #0f171d; + color:#FFF; + + .top-bar-container{ + background: #0f171d; + color:#35465c; + } + } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/styles/shared.scss b/src/Ombi/ClientApp/src/styles/shared.scss index 27bfa6c7d..dda039602 100644 --- a/src/Ombi/ClientApp/src/styles/shared.scss +++ b/src/Ombi/ClientApp/src/styles/shared.scss @@ -62,7 +62,7 @@ body { ::-webkit-scrollbar { width: 7px; - background: #818181; + background: #0f171d; } ::-webkit-scrollbar-track { @@ -72,7 +72,7 @@ body { // Changed color of the scrollbar ::-webkit-scrollbar-thumb { border-radius: 3px; - background: #303030; + background: #35465c; } .sidenav ::-webkit-scrollbar-track { From 596d09c6d5b5dc68311c9b3c2341bceb80ac9cf6 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 15 Jan 2021 08:14:52 +0000 Subject: [PATCH 05/18] Use some new vars in the scss --- .../carousel-list/carousel-list.component.scss | 6 +++--- .../ClientApp/src/app/my-nav/my-nav.component.scss | 12 ++++++------ src/Ombi/ClientApp/src/styles/variables.scss | 8 +++++++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss index d640fbe8e..346179dd7 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss @@ -63,8 +63,8 @@ } .discover-filter-buttons-group { - background: #0f171d; - border: 1px solid #35465c; + background: $ombi-background-primary; + border: 1px solid $ombi-background-primary-accent; border-radius: 30px; color:#fff; margin-bottom:10px; @@ -78,7 +78,7 @@ } .discover-filter-button.cdk-focused{ - background:#62d2fa; + background:$ombi-active; } .discover-filter-button .mat-button-toggle-button:focus{ diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss index d0f1bdcc9..ed853ac4d 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss @@ -122,7 +122,7 @@ .application-name{ font-family: 'Montserrat', sans-serif; text-transform: uppercase; - color:#62d2fa; + color: $ombi-active; align-items:center; justify-content: center; font-weight: 700; @@ -148,8 +148,8 @@ } .active-list-item{ - color:#1b242f; - background: #62d2fa; + color:$ombi-background-accent; + background: $ombi-active; border-radius:0px 30px 30px 0px; padding:10px 20px; height:auto; @@ -162,12 +162,12 @@ } .content-container{ - background: #0f171d; + background: $ombi-background-primary; color:#FFF; .top-bar-container{ - background: #0f171d; - color:#35465c; + background: $ombi-background-primary; + color:$ombi-background-primary-accent; } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/styles/variables.scss b/src/Ombi/ClientApp/src/styles/variables.scss index 2bd0d40e5..3e497bbc8 100644 --- a/src/Ombi/ClientApp/src/styles/variables.scss +++ b/src/Ombi/ClientApp/src/styles/variables.scss @@ -36,4 +36,10 @@ $text-dark: white; $panel: mat-color(mat-palette($mat-grey, 800)); $primary-dark: mat-color($ombi-dark-app-primary); $accent-dark: mat-color($ombi-dark-app-accent); -$warn-dark: mat-color($ombi-dark-app-warn); \ No newline at end of file +$warn-dark: mat-color($ombi-dark-app-warn); + + +$ombi-active: #62d2fa; +$ombi-background-accent: #1b242f; +$ombi-background-primary: #0f171f; +$ombi-background-primary-accent: #35465c; \ No newline at end of file From 7c0210f62fc30a3de0426ce0c32a22369ad06f74 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 15 Jan 2021 08:15:22 +0000 Subject: [PATCH 06/18] added import --- .../components/carousel-list/carousel-list.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss index 346179dd7..8e285ddb7 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss +++ b/src/Ombi/ClientApp/src/app/discover/components/carousel-list/carousel-list.component.scss @@ -1,4 +1,4 @@ - +@import "~styles/variables.scss"; .ombi-card { padding: 5px; From 63b8984dbf43f6617b20b036842c7dfa3806a691 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 15 Jan 2021 08:39:17 +0000 Subject: [PATCH 07/18] changed some of the base theming --- src/Ombi/ClientApp/angular.json | 2 -- src/Ombi/ClientApp/src/app/app.component.html | 2 +- src/Ombi/ClientApp/src/styles/Styles.scss | 2 -- src/Ombi/ClientApp/src/styles/shared.scss | 4 ++-- src/Ombi/ClientApp/src/styles/variables.scss | 17 +++++++++-------- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Ombi/ClientApp/angular.json b/src/Ombi/ClientApp/angular.json index 4038c9a56..0dd70fd7a 100644 --- a/src/Ombi/ClientApp/angular.json +++ b/src/Ombi/ClientApp/angular.json @@ -25,10 +25,8 @@ "src/assets" ], "styles": [ - "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css", "src/styles/_imports.scss", "node_modules/bootstrap/scss/bootstrap.scss", - "node_modules/primeng/resources/themes/md-dark-deeppurple/theme.css", "node_modules/font-awesome/scss/font-awesome.scss", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeicons/primeicons.css", diff --git a/src/Ombi/ClientApp/src/app/app.component.html b/src/Ombi/ClientApp/src/app/app.component.html index d4297aeb4..1f3f4012c 100644 --- a/src/Ombi/ClientApp/src/app/app.component.html +++ b/src/Ombi/ClientApp/src/app/app.component.html @@ -170,7 +170,7 @@
- + diff --git a/src/Ombi/ClientApp/src/styles/Styles.scss b/src/Ombi/ClientApp/src/styles/Styles.scss index 41539ca61..5345ea995 100644 --- a/src/Ombi/ClientApp/src/styles/Styles.scss +++ b/src/Ombi/ClientApp/src/styles/Styles.scss @@ -21,6 +21,4 @@ $dark-theme: mat-dark-theme($ombi-dark-app-primary, $ombi-dark-app-accent, $ombi // `.dark` will be affected by this alternate dark theme instead of the default theme. .dark { @include angular-material-theme($dark-theme); - - } \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/styles/shared.scss b/src/Ombi/ClientApp/src/styles/shared.scss index dda039602..bd1c0b37f 100644 --- a/src/Ombi/ClientApp/src/styles/shared.scss +++ b/src/Ombi/ClientApp/src/styles/shared.scss @@ -39,7 +39,7 @@ html, body { min-height: 100vh; overflow: initial; - scrollbar-color: #616161 #303030; //firefox + // scrollbar-color: #616161 #303030; //firefox scrollbar-width: thin; //firefox -webkit-overflow-scrolling: touch; } @@ -106,7 +106,7 @@ table { } ::ng-deep .dark .nav-link.active { - color: #303030; + color: $ombi-active; background-color: $accent-dark; border-color: rgba(0, 0, 0, 0.18); font-weight: 400; diff --git a/src/Ombi/ClientApp/src/styles/variables.scss b/src/Ombi/ClientApp/src/styles/variables.scss index 3e497bbc8..e1a05bf68 100644 --- a/src/Ombi/ClientApp/src/styles/variables.scss +++ b/src/Ombi/ClientApp/src/styles/variables.scss @@ -1,17 +1,18 @@ -@import "./mat-palette.scss"; +// @import "./mat-palette.scss"; @import '~@angular/material/theming'; +@import "./new-mat-palette.scss"; // BASE // Define the palettes for your theme using the Material Design palettes available in palette.scss // (imported above). For each palette, you can optionally specify a default, lighter, and darker // hue. Available color palettes: https://material.io/design/color/ $ombi-app-primary: mat-palette($ombi-primary); -$ombi-app-accent : mat-palette($ombi-accent, 400); +$ombi-app-accent : mat-palette($ombi-accent); // The warn palette is optional (defaults to red). $ombi-app-warn : mat-palette($mat-deep-orange); // Define an alternate dark theme. -$ombi-dark-app-primary: mat-palette($mat-grey, 800); -$ombi-dark-app-accent: mat-palette($mat-amber, A200, A100, A400); +$ombi-dark-app-primary: mat-palette($ombi-primary); +$ombi-dark-app-accent: mat-palette($ombi-accent); $ombi-dark-app-warn: mat-palette($mat-deep-orange); @@ -30,16 +31,16 @@ $warn: mat-color($ombi-app-warn); // DARK -$background-dark: mat-color(mat-palette($mat-grey, 800));; +$background-dark: mat-color( mat-palette($ombi-background)); $backgroundTint-dark: mat-color(mat-palette($mat-grey, 900)); $text-dark: white; -$panel: mat-color(mat-palette($mat-grey, 800)); +$panel: mat-color($ombi-dark-app-primary); $primary-dark: mat-color($ombi-dark-app-primary); $accent-dark: mat-color($ombi-dark-app-accent); $warn-dark: mat-color($ombi-dark-app-warn); -$ombi-active: #62d2fa; -$ombi-background-accent: #1b242f; +$ombi-active: mat-color($ombi-dark-app-accent); +$ombi-background-accent: mat-color($ombi-dark-app-primary); $ombi-background-primary: #0f171f; $ombi-background-primary-accent: #35465c; \ No newline at end of file From 18799f476a19996db0dbd5dd67979fbf34becbe3 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Mon, 18 Jan 2021 22:56:52 +0000 Subject: [PATCH 08/18] Err, this is a good one. Really happy with this. But please don't tell anyone --- src/Ombi/ClientApp/angular.json | 2 ++ src/Ombi/ClientApp/package.json | 1 + src/Ombi/ClientApp/src/app/app.component.html | 2 +- src/Ombi/ClientApp/src/app/app.component.ts | 9 --------- .../src/app/my-nav/my-nav.component.html | 5 ----- .../src/app/my-nav/my-nav.component.scss | 4 ++-- .../src/app/my-nav/my-nav.component.ts | 15 --------------- .../movies-grid/movies-grid.component.scss | 4 ++-- src/Ombi/ClientApp/src/index.html | 2 +- src/Ombi/ClientApp/src/styles/Styles.scss | 17 ++++++++--------- .../src/styles/material-overrides.scss | 17 +++++++++++++++++ src/Ombi/ClientApp/src/styles/variables.scss | 10 +++++----- src/Ombi/ClientApp/yarn.lock | 5 +++++ 13 files changed, 44 insertions(+), 49 deletions(-) diff --git a/src/Ombi/ClientApp/angular.json b/src/Ombi/ClientApp/angular.json index 0dd70fd7a..cd17cccc0 100644 --- a/src/Ombi/ClientApp/angular.json +++ b/src/Ombi/ClientApp/angular.json @@ -25,8 +25,10 @@ "src/assets" ], "styles": [ + "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles/_imports.scss", "node_modules/bootstrap/scss/bootstrap.scss", + "node_modules/primeng/resources/themes/md-dark-deeppurple/theme.css", "node_modules/font-awesome/scss/font-awesome.scss", "node_modules/primeng/resources/primeng.min.css", "node_modules/primeicons/primeicons.css", diff --git a/src/Ombi/ClientApp/package.json b/src/Ombi/ClientApp/package.json index 8f1e6384a..777dcfe8c 100644 --- a/src/Ombi/ClientApp/package.json +++ b/src/Ombi/ClientApp/package.json @@ -54,6 +54,7 @@ "primeicons": "^4.0.0", "primeng": "^11.0.0", "rxjs": "^6.5.2", + "sass-recursive-map-merge": "^1.0.1", "spinkit": "^1.2.5", "store": "^2.0.12", "ts-md5": "^1.2.7", diff --git a/src/Ombi/ClientApp/src/app/app.component.html b/src/Ombi/ClientApp/src/app/app.component.html index 1f3f4012c..f5f2d82eb 100644 --- a/src/Ombi/ClientApp/src/app/app.component.html +++ b/src/Ombi/ClientApp/src/app/app.component.html @@ -170,7 +170,7 @@
- + diff --git a/src/Ombi/ClientApp/src/app/app.component.ts b/src/Ombi/ClientApp/src/app/app.component.ts index f6f9fe62a..40ece5d31 100644 --- a/src/Ombi/ClientApp/src/app/app.component.ts +++ b/src/Ombi/ClientApp/src/app/app.component.ts @@ -85,8 +85,6 @@ export class AppComponent implements OnInit { public ngOnInit() { window["loading_screen"].finish(); - const theme = this.storage.get("theme"); - this.onSetTheme(theme); this.settingsService.getCustomization().subscribe(x => { this.customizationSettings = x; @@ -131,11 +129,4 @@ export class AppComponent implements OnInit { this.authService.logout(); this.router.navigate(["login"]); } - - public onSetTheme(theme: string) { - if (theme) { - this.overlayContainer.getContainerElement().classList.add(theme); - this.componentCssClass = theme; - } - } } diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html index ff54f9241..368341b3d 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.html @@ -42,11 +42,6 @@
- - wb_incandescent - brightness_4 -  {{ 'NavigationBar.ChangeTheme' | translate }} - exit_to_app diff --git a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss index ed853ac4d..6d6559a44 100644 --- a/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss +++ b/src/Ombi/ClientApp/src/app/my-nav/my-nav.component.scss @@ -114,7 +114,7 @@ // New CSS for new style // .sidenav-container .sidenav{ - background: #1b242f; + background: $ombi-background-accent; color:#FFF; width: 23rem; font-family: 'Montserrat', sans-serif; @@ -167,7 +167,7 @@ .top-bar-container{ background: $ombi-background-primary; - color:$ombi-background-primary-accent; + color:$ombi-background-primary-accent; } } \ No newline at end of file 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 cafef32a8..9a5ec794c 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 @@ -37,7 +37,6 @@ export class MyNavComponent implements OnInit { @Input() public isAdmin: string; @Input() public email: string; @Output() public logoutClick = new EventEmitter(); - @Output() public themeChange = new EventEmitter(); public theme: string; public issuesEnabled: boolean = false; public navItems: INavBar[]; @@ -98,20 +97,6 @@ export class MyNavComponent implements OnInit { this.logoutClick.emit(); } - public switchTheme() { - if (this.theme) { - let newTheme = ""; - if (this.theme === "dark") { - newTheme = "light"; - } else { - newTheme = "dark"; - } - this.store.save("theme", newTheme) - this.theme = newTheme; - this.themeChange.emit(newTheme); - } - } - public changeFilter(event: MatSlideToggleChange, searchFilterType: SearchFilterType) { switch (searchFilterType) { case SearchFilterType.Movie: diff --git a/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.scss b/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.scss index fd5a5e47c..c911bec1b 100644 --- a/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.scss +++ b/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.scss @@ -4,7 +4,7 @@ background: $accent-dark !important; font-size: 1em; font-weight: bold; - color: #303030; + color: $ombi-background-primary-accent; } .mat-form-field { @@ -23,7 +23,7 @@ ::ng-deep .dark .mat-tab-label-active{ background: $accent-dark !important; - color: #303030 !important; + color: $ombi-background-primary-accent !important; font-weight:bold; } diff --git a/src/Ombi/ClientApp/src/index.html b/src/Ombi/ClientApp/src/index.html index f7804c77f..5659be377 100644 --- a/src/Ombi/ClientApp/src/index.html +++ b/src/Ombi/ClientApp/src/index.html @@ -57,7 +57,7 @@ - +