mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-31 12:00:06 -07:00
Fixed #1878 and added a Request all button when selecting episodes
This commit is contained in:
parent
6d02882990
commit
108d343fec
5 changed files with 15 additions and 27 deletions
|
@ -83,11 +83,11 @@ namespace Ombi.Core.Rule.Rules.Search
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.All(e => e.Approved)))
|
if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.All(e => e.Available)))
|
||||||
{
|
{
|
||||||
request.FullyAvailable = true;
|
request.FullyAvailable = true;
|
||||||
}
|
}
|
||||||
if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.Any(e => e.Approved)))
|
if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.Any(e => e.Available)))
|
||||||
{
|
{
|
||||||
request.PartlyAvailable = true;
|
request.PartlyAvailable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" id="search" class="form-control form-control-custom searchwidth" placeholder="Search" (keyup)="search($event)">
|
<input type="text" id="search" class="form-control form-control-custom searchwidth" placeholder="Search" (keyup)="search($event)">
|
||||||
<span class="input-group-btn"> <button class="btn btn-sm btn-info-outline" (click)="filterDisplay = true" >
|
<span class="input-group-btn">
|
||||||
|
<button id="filterBtn" class="btn btn-sm btn-info-outline" (click)="filterDisplay = true" >
|
||||||
<i class="fa fa-filter"></i> {{ 'Requests.Filter' | translate }}</button>
|
<i class="fa fa-filter"></i> {{ 'Requests.Filter' | translate }}</button>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
@ -191,12 +192,6 @@
|
||||||
<label for="approved">{{ 'Filter.Approved' | translate }}</label>
|
<label for="approved">{{ 'Filter.Approved' | translate }}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
|
||||||
<div class="radio">
|
|
||||||
<input type="radio" id="notApproved" name="Status" (click)="filterStatus(filterType.NotApproved)">
|
|
||||||
<label for="notApproved">{{ 'Filter.NotApproved' | translate }}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="radio">
|
<div class="radio">
|
||||||
<input type="radio" id="Processing" name="Status" (click)="filterStatus(filterType.Processing)">
|
<input type="radio" id="Processing" name="Status" (click)="filterStatus(filterType.Processing)">
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
<ngb-tab [id]="season.seasonNumber" [title]="season.seasonNumber">
|
<ngb-tab [id]="season.seasonNumber" [title]="season.seasonNumber">
|
||||||
<ng-template ngbTabContent>
|
<ng-template ngbTabContent>
|
||||||
<h2>Season: {{season.seasonNumber}}</h2>
|
<h2>Season: {{season.seasonNumber}}</h2>
|
||||||
|
|
||||||
|
<button (click)="addAllEpisodes(season)" class="btn btn-sm btn-primary-outline">Select All in Season {{season.seasonNumber}}</button>
|
||||||
<table class="table table-striped table-hover table-responsive table-condensed">
|
<table class="table table-striped table-hover table-responsive table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
import { Component, Input, OnDestroy, OnInit} from "@angular/core";
|
import { Component, Input, OnInit} from "@angular/core";
|
||||||
import { Subject } from "rxjs/Subject";
|
|
||||||
|
|
||||||
import "rxjs/add/operator/takeUntil";
|
import "rxjs/add/operator/takeUntil";
|
||||||
|
|
||||||
import { NotificationService } from "../services";
|
import { NotificationService } from "../services";
|
||||||
import { RequestService } from "../services";
|
import { RequestService } from "../services";
|
||||||
import { SearchService } from "../services";
|
import { SearchService } from "../services";
|
||||||
|
|
||||||
import { IRequestEngineResult } from "../interfaces";
|
import { INewSeasonRequests, IRequestEngineResult } from "../interfaces";
|
||||||
import { IEpisodesRequests } from "../interfaces";
|
import { IEpisodesRequests } from "../interfaces";
|
||||||
import { ISearchTvResult } from "../interfaces";
|
import { ISearchTvResult } from "../interfaces";
|
||||||
|
|
||||||
|
@ -16,20 +14,18 @@ import { ISearchTvResult } from "../interfaces";
|
||||||
templateUrl: "./seriesinformation.component.html",
|
templateUrl: "./seriesinformation.component.html",
|
||||||
styleUrls: ["./seriesinformation.component.scss"],
|
styleUrls: ["./seriesinformation.component.scss"],
|
||||||
})
|
})
|
||||||
export class SeriesInformationComponent implements OnInit, OnDestroy {
|
export class SeriesInformationComponent implements OnInit {
|
||||||
|
|
||||||
public result: IRequestEngineResult;
|
public result: IRequestEngineResult;
|
||||||
public series: ISearchTvResult;
|
public series: ISearchTvResult;
|
||||||
public requestedEpisodes: IEpisodesRequests[] = [];
|
public requestedEpisodes: IEpisodesRequests[] = [];
|
||||||
|
|
||||||
@Input() private seriesId: number;
|
@Input() private seriesId: number;
|
||||||
private subscriptions = new Subject<void>();
|
|
||||||
|
|
||||||
constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService) { }
|
constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService) { }
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.searchService.getShowInformation(this.seriesId)
|
this.searchService.getShowInformation(this.seriesId)
|
||||||
.takeUntil(this.subscriptions)
|
|
||||||
.subscribe(x => {
|
.subscribe(x => {
|
||||||
this.series = x;
|
this.series = x;
|
||||||
});
|
});
|
||||||
|
@ -51,7 +47,6 @@ export class SeriesInformationComponent implements OnInit, OnDestroy {
|
||||||
this.series.requested = true;
|
this.series.requested = true;
|
||||||
|
|
||||||
this.requestService.requestTv(this.series)
|
this.requestService.requestTv(this.series)
|
||||||
.takeUntil(this.subscriptions)
|
|
||||||
.subscribe(x => {
|
.subscribe(x => {
|
||||||
this.result = x as IRequestEngineResult;
|
this.result = x as IRequestEngineResult;
|
||||||
if (this.result.result) {
|
if (this.result.result) {
|
||||||
|
@ -80,8 +75,7 @@ export class SeriesInformationComponent implements OnInit, OnDestroy {
|
||||||
episode.selected = false;
|
episode.selected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnDestroy() {
|
public addAllEpisodes(season: INewSeasonRequests) {
|
||||||
this.subscriptions.next();
|
season.episodes.forEach((ep) => this.addRequest(ep));
|
||||||
this.subscriptions.complete();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,12 +79,10 @@
|
||||||
<span *ngIf="node.data.network" class="label label-info" id="networkLabel" target="_blank">{{node.data.network}}</span>
|
<span *ngIf="node.data.network" class="label label-info" id="networkLabel" target="_blank">{{node.data.network}}</span>
|
||||||
|
|
||||||
|
|
||||||
<ng-template [ngIf]="node.data.available">
|
<span *ngIf="node.data.available" class="label label-success" id="availableLabel">Available</span>
|
||||||
<span class="label label-success" id="availableLabel">Available</span>
|
|
||||||
</ng-template>
|
<span *ngIf="node.data.partlyAvailable" class="label label-warning" id="partiallyAvailableLabel">Partially Available</span>
|
||||||
<ng-template [ngIf]="node.data.partlyAvailable">
|
|
||||||
<span class="label label-warning" id="partiallyAvailableLabel">Partially Available</span>
|
|
||||||
</ng-template>
|
|
||||||
|
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue