mirror of https://github.com/Ombi-app/Ombi
parent
a70e9403c7
commit
18374198f9
@ -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>
|
@ -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;
|
||||
}
|
||||
|
@ -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`]);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in new issue