mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 04:49:33 -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;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IMovieDbGenre {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<form [formGroup]='tagForm'>
|
<form [formGroup]='tagForm'>
|
||||||
|
|
||||||
<mat-form-field class="example-full-width">
|
<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"
|
formControlName="input" [matAutocomplete]="auto"
|
||||||
matTooltip="Prevent movies with certain keywords from being suggested. May require a restart to take effect.">
|
matTooltip="Prevent movies with certain keywords from being suggested. May require a restart to take effect.">
|
||||||
<mat-autocomplete (optionSelected)="optionSelected($event.option.value)" autoActiveFirstOption
|
<mat-autocomplete (optionSelected)="optionSelected($event.option.value)" autoActiveFirstOption
|
||||||
|
@ -34,6 +34,46 @@
|
||||||
</mat-chip>
|
</mat-chip>
|
||||||
</mat-chip-list>
|
</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>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -52,4 +92,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { Component, OnInit, ElementRef, ViewChild } from "@angular/core";
|
import { Component, OnInit, ElementRef, ViewChild } from "@angular/core";
|
||||||
import { MatAutocomplete } from "@angular/material/autocomplete";
|
import { MatAutocomplete } from "@angular/material/autocomplete";
|
||||||
|
|
||||||
import { ITheMovieDbSettings, IMovieDbKeyword } from "../../interfaces";
|
import { ITheMovieDbSettings, IMovieDbKeyword, IMovieDbGenre } from "../../interfaces";
|
||||||
import { NotificationService } from "../../services";
|
import { NotificationService } from "../../services";
|
||||||
import { SettingsService } from "../../services";
|
import { SettingsService } from "../../services";
|
||||||
import { TheMovieDbService } from "../../services";
|
import { TheMovieDbService } from "../../services";
|
||||||
|
@ -15,6 +15,11 @@ interface IKeywordTag {
|
||||||
initial: boolean;
|
initial: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface IGenres {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "./themoviedb.component.html",
|
templateUrl: "./themoviedb.component.html",
|
||||||
styleUrls: ["./themoviedb.component.scss"]
|
styleUrls: ["./themoviedb.component.scss"]
|
||||||
|
@ -23,8 +28,13 @@ export class TheMovieDbComponent implements OnInit {
|
||||||
|
|
||||||
public settings: ITheMovieDbSettings;
|
public settings: ITheMovieDbSettings;
|
||||||
public excludedKeywords: IKeywordTag[];
|
public excludedKeywords: IKeywordTag[];
|
||||||
|
public excludedMovieGenres: IGenres[];
|
||||||
|
public excludedTvGenres: IGenres[];
|
||||||
public tagForm: FormGroup;
|
public tagForm: FormGroup;
|
||||||
public filteredTags: IMovieDbKeyword[];
|
public filteredTags: IMovieDbKeyword[];
|
||||||
|
public filteredMovieGenres: IMovieDbGenre[];
|
||||||
|
public filteredTvGenres: IMovieDbGenre[];
|
||||||
|
|
||||||
@ViewChild('fruitInput') public fruitInput: ElementRef<HTMLInputElement>;
|
@ViewChild('fruitInput') public fruitInput: ElementRef<HTMLInputElement>;
|
||||||
|
|
||||||
constructor(private settingsService: SettingsService,
|
constructor(private settingsService: SettingsService,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue