-
-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[skip-ci]
- Loading branch information
Showing
5 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="genre-container"> | ||
<mat-button-toggle-group name="discoverMode" (change)="toggleChanged($event)" *ngFor="let genre of genreList" | ||
class="discover-filter-buttons-group"> | ||
<mat-button-toggle value="{{genre.id}}" class="discover-filter-button">{{genre.name}}</mat-button-toggle> | ||
</mat-button-toggle-group> | ||
<mat-spinner *ngIf="isLoading" [diameter]="30"></mat-spinner> | ||
</div> |
32 changes: 32 additions & 0 deletions
32
src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
h2{ | ||
margin-top:40px; | ||
margin-left:40px; | ||
font-size: 24px; | ||
} | ||
|
||
.discover-filter-buttons-group { | ||
border: 1px solid #293a4c; | ||
border-radius: 30px; | ||
color:#fff; | ||
margin-bottom:10px; | ||
|
||
.discover-filter-button{ | ||
background:inherit; | ||
color:inherit; | ||
padding:0 0px; | ||
border-radius: 30px; | ||
padding-left: 20px; | ||
padding-right: 20px; | ||
border-left:none; | ||
} | ||
} | ||
|
||
.button-active{ | ||
background:#293a4c; | ||
} | ||
|
||
.genre-container { | ||
margin-left: 35px; | ||
} | ||
|
50 changes: 50 additions & 0 deletions
50
src/Ombi/ClientApp/src/app/discover/components/genre/genre-button-select.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Component, OnInit } from "@angular/core"; | ||
import { SearchV2Service } from "../../../services"; | ||
import { AuthService } from "../../../auth/auth.service"; | ||
import { IMovieDbKeyword } from "../../../interfaces"; | ||
import { MatButtonToggleChange } from "@angular/material/button-toggle"; | ||
import { CarouselListComponent } from "../carousel-list/carousel-list.component"; | ||
import { RequestType } from "../../../interfaces"; | ||
import { AdvancedSearchDialogDataService } from "app/shared/advanced-search-dialog/advanced-search-dialog-data.service"; | ||
import { Router } from "@angular/router"; | ||
|
||
@Component({ | ||
selector: "genre-button-select", | ||
templateUrl: "./genre-button-select.component.html", | ||
styleUrls: ["./genre-button-select.component.scss"], | ||
}) | ||
export class GenreButtonSelectComponent implements OnInit { | ||
public genreList: IMovieDbKeyword[] = []; | ||
public selectedGenre: IMovieDbKeyword; | ||
public mediaType: string = "movie"; | ||
|
||
isLoading: boolean = false; | ||
|
||
constructor(private searchService: SearchV2Service, | ||
private advancedSearchService: AdvancedSearchDialogDataService, | ||
private router: Router) { } | ||
|
||
public ngOnInit(): void { | ||
this.searchService.getGenres(this.mediaType).subscribe(results => { | ||
this.genreList = results; | ||
}); | ||
} | ||
|
||
public async toggleChanged(event: MatButtonToggleChange) { | ||
this.isLoading = true; | ||
|
||
const genres: number[] = [event.value]; | ||
const data = await this.searchService.advancedSearch({ | ||
watchProviders: [], | ||
genreIds: genres, | ||
keywordIds: [], | ||
type: this.mediaType, | ||
}, 0, 30); | ||
|
||
this.advancedSearchService.setData(data, RequestType.movie); | ||
this.advancedSearchService.setOptions([], genres, [], null, RequestType.movie, 30); | ||
this.router.navigate([`discover/advanced/search`]); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters