mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
Create Genre structs
This commit is contained in:
parent
f3f52e1e3b
commit
341f6583de
3 changed files with 58 additions and 3 deletions
|
@ -2,3 +2,8 @@
|
|||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface IMovieDbGenre {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<form [formGroup]='tagForm'>
|
||||
|
||||
<mat-form-field class="example-full-width">
|
||||
<input type="text" placeholder="Excluded Keyword IDs for Movie Suggestions" matInput
|
||||
<input type="text" placeholder="Excluded Keyword IDs for Movie & TV Suggestions" matInput
|
||||
formControlName="input" [matAutocomplete]="auto"
|
||||
matTooltip="Prevent movies with certain keywords from being suggested. May require a restart to take effect.">
|
||||
<mat-autocomplete (optionSelected)="optionSelected($event.option.value)" autoActiveFirstOption
|
||||
|
@ -34,6 +34,46 @@
|
|||
</mat-chip>
|
||||
</mat-chip-list>
|
||||
|
||||
<mat-form-field class="example-full-width">
|
||||
<input type="text" placeholder="Excluded Genres for Movie Suggestions" matInput
|
||||
formControlName="input" [matAutocomplete]="auto"
|
||||
matTooltip="Prevent movies with certain genres from being suggested. May require a restart to take effect.">
|
||||
<mat-autocomplete (optionSelected)="optionSelected($event.option.value)" autoActiveFirstOption
|
||||
#auto="matAutocomplete">
|
||||
<mat-option *ngFor="let option of filteredMovieGenres" [value]="option">
|
||||
{{option.name}}
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-chip-list #chipList>
|
||||
<mat-chip *ngFor="let key of excludedMovieGenres" [selectable]="false" [removable]="true"
|
||||
(removed)="remove(key)">
|
||||
{{key.name}}
|
||||
<i matChipRemove class="fas fa-times fa-lg"></i>
|
||||
</mat-chip>
|
||||
</mat-chip-list>
|
||||
|
||||
<mat-form-field class="example-full-width">
|
||||
<input type="text" placeholder="Excluded Genres for TV Suggestions" matInput
|
||||
formControlName="input" [matAutocomplete]="auto"
|
||||
matTooltip="Prevent TV Shows with certain genres from being suggested. May require a restart to take effect.">
|
||||
<mat-autocomplete (optionSelected)="optionSelected($event.option.value)" autoActiveFirstOption
|
||||
#auto="matAutocomplete">
|
||||
<mat-option *ngFor="let option of filteredTvGenres" [value]="option">
|
||||
{{option.name}}
|
||||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-chip-list #chipList>
|
||||
<mat-chip *ngFor="let key of excludedTvGenres" [selectable]="false" [removable]="true"
|
||||
(removed)="remove(key)">
|
||||
{{key.name}}
|
||||
<i matChipRemove class="fas fa-times fa-lg"></i>
|
||||
</mat-chip>
|
||||
</mat-chip-list>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
@ -52,4 +92,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { Component, OnInit, ElementRef, ViewChild } from "@angular/core";
|
||||
import { MatAutocomplete } from "@angular/material/autocomplete";
|
||||
|
||||
import { ITheMovieDbSettings, IMovieDbKeyword } from "../../interfaces";
|
||||
import { ITheMovieDbSettings, IMovieDbKeyword, IMovieDbGenre } from "../../interfaces";
|
||||
import { NotificationService } from "../../services";
|
||||
import { SettingsService } from "../../services";
|
||||
import { TheMovieDbService } from "../../services";
|
||||
|
@ -15,6 +15,11 @@ interface IKeywordTag {
|
|||
initial: boolean;
|
||||
}
|
||||
|
||||
interface IGenres {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
templateUrl: "./themoviedb.component.html",
|
||||
styleUrls: ["./themoviedb.component.scss"]
|
||||
|
@ -23,8 +28,13 @@ export class TheMovieDbComponent implements OnInit {
|
|||
|
||||
public settings: ITheMovieDbSettings;
|
||||
public excludedKeywords: IKeywordTag[];
|
||||
public excludedMovieGenres: IGenres[];
|
||||
public excludedTvGenres: IGenres[];
|
||||
public tagForm: FormGroup;
|
||||
public filteredTags: IMovieDbKeyword[];
|
||||
public filteredMovieGenres: IMovieDbGenre[];
|
||||
public filteredTvGenres: IMovieDbGenre[];
|
||||
|
||||
@ViewChild('fruitInput') public fruitInput: ElementRef<HTMLInputElement>;
|
||||
|
||||
constructor(private settingsService: SettingsService,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue