mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-24 23:15:23 -07:00
improvements
This commit is contained in:
parent
e2acd01507
commit
9b49fe0208
4 changed files with 71 additions and 13 deletions
|
@ -76,16 +76,3 @@
|
||||||
<button *ngIf="!request.denied" mat-raised-button color="danger" (click)="deny(request);">{{ 'Requests.Deny' | translate }}</button>
|
<button *ngIf="!request.denied" mat-raised-button color="danger" (click)="deny(request);">{{ 'Requests.Deny' | translate }}</button>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<button *ngIf="!tv.fullyAvailable && requestable" mat-fab color="accent" id="addFabBtn" class="floating-fab" [matMenuTriggerFor]="aboveMenu">
|
|
||||||
<i class="fas fa-plus fa-lg"></i>
|
|
||||||
<mat-menu #aboveMenu="matMenu" yPosition="above">
|
|
||||||
<button id="requestAll" mat-menu-item (click)="requestAllSeasons()">{{ 'Search.TvShows.AllSeasons' | translate }}</button>
|
|
||||||
|
|
||||||
<button id="requestFirst" mat-menu-item (click)="requestFirstSeason()">{{ 'Search.TvShows.FirstSeason' | translate }}</button>
|
|
||||||
|
|
||||||
<button id="requestLatest" mat-menu-item (click)="requestLatestSeason()">{{ 'Search.TvShows.LatestSeason' | translate }}</button>
|
|
||||||
|
|
||||||
<button id="requestSelected" mat-menu-item (click)="submitRequests()">{{ 'Common.Request' | translate }}</button>
|
|
||||||
</mat-menu>
|
|
||||||
</button>
|
|
||||||
|
|
|
@ -229,6 +229,17 @@
|
||||||
</mat-accordion>
|
</mat-accordion>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- FAB Button moved outside of deferred components so it's always visible -->
|
||||||
|
<button *ngIf="!tv.fullyAvailable && (!tv.partlyAvailable || tv.partlyAvailable)" mat-fab color="accent" id="addFabBtn" class="floating-fab" [matMenuTriggerFor]="aboveMenu">
|
||||||
|
<i class="fas fa-plus fa-lg"></i>
|
||||||
|
<mat-menu #aboveMenu="matMenu" yPosition="above">
|
||||||
|
<button id="requestAll" mat-menu-item (click)="requestAllSeasons()">{{ 'Search.TvShows.AllSeasons' | translate }}</button>
|
||||||
|
<button id="requestFirst" mat-menu-item (click)="requestFirstSeason()">{{ 'Search.TvShows.FirstSeason' | translate }}</button>
|
||||||
|
<button id="requestLatest" mat-menu-item (click)="requestLatestSeason()">{{ 'Search.TvShows.LatestSeason' | translate }}</button>
|
||||||
|
<button id="requestSelected" mat-menu-item (click)="submitRequests()">{{ 'Common.Request' | translate }}</button>
|
||||||
|
</mat-menu>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="bottom-page-gap"></div>
|
<div class="bottom-page-gap"></div>
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { TvAdvancedOptionsComponent } from "./panels/tv-advanced-options/tv-adva
|
||||||
import { RequestServiceV2 } from "../../../services/requestV2.service";
|
import { RequestServiceV2 } from "../../../services/requestV2.service";
|
||||||
import { forkJoin } from "rxjs";
|
import { forkJoin } from "rxjs";
|
||||||
import { SonarrFacade } from "app/state/sonarr";
|
import { SonarrFacade } from "app/state/sonarr";
|
||||||
|
import { ITvRequestViewModelV2 } from "../../../interfaces/ISearchTvResult";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
standalone: false,
|
standalone: false,
|
||||||
|
@ -135,6 +136,57 @@ export class TvDetailsComponent implements OnInit {
|
||||||
return this.tv.seasonRequests.every(e => e.episodes.every(x => x.available || x.approved || x.requested));
|
return this.tv.seasonRequests.every(e => e.episodes.every(x => x.available || x.approved || x.requested));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FAB Button methods moved from tv-request-grid component
|
||||||
|
public requestAllSeasons() {
|
||||||
|
this.tv.requestAll = true;
|
||||||
|
this.tv.firstSeason = false;
|
||||||
|
this.tv.latestSeason = false;
|
||||||
|
this.submitRequests();
|
||||||
|
}
|
||||||
|
|
||||||
|
public requestFirstSeason() {
|
||||||
|
this.tv.requestAll = false;
|
||||||
|
this.tv.firstSeason = true;
|
||||||
|
this.tv.latestSeason = false;
|
||||||
|
this.submitRequests();
|
||||||
|
}
|
||||||
|
|
||||||
|
public requestLatestSeason() {
|
||||||
|
this.tv.requestAll = false;
|
||||||
|
this.tv.firstSeason = false;
|
||||||
|
this.tv.latestSeason = true;
|
||||||
|
this.submitRequests();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async submitRequests() {
|
||||||
|
// Make sure something has been selected
|
||||||
|
if (!this.tv.requestAll && !this.tv.firstSeason && !this.tv.latestSeason) {
|
||||||
|
this.messageService.send('You need to select some episodes!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.tv.requested = true;
|
||||||
|
|
||||||
|
const viewModel = <ITvRequestViewModelV2>{
|
||||||
|
firstSeason: this.tv.firstSeason,
|
||||||
|
latestSeason: this.tv.latestSeason,
|
||||||
|
requestAll: this.tv.requestAll,
|
||||||
|
theMovieDbId: this.tv.id,
|
||||||
|
requestOnBehalf: null,
|
||||||
|
languageCode: 'en' // Default language, can be enhanced later
|
||||||
|
};
|
||||||
|
viewModel.seasons = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.requestService2.requestTv(viewModel).toPromise();
|
||||||
|
this.messageService.send(`Request for ${this.tv.title} has been added successfully`);
|
||||||
|
// Refresh the data
|
||||||
|
await this.load();
|
||||||
|
} catch (error) {
|
||||||
|
this.messageService.send('Failed to submit request');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private checkPoster() {
|
private checkPoster() {
|
||||||
if (this.tv.images.original == null) {
|
if (this.tv.images.original == null) {
|
||||||
this.tv.images.original = "../../../images/default_movie_poster.png";
|
this.tv.images.original = "../../../images/default_movie_poster.png";
|
||||||
|
|
|
@ -99,6 +99,14 @@
|
||||||
min-height: 600px;
|
min-height: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FAB Button styling moved from tv-request-grid component
|
||||||
|
.floating-fab {
|
||||||
|
position: fixed;
|
||||||
|
right: 3%;
|
||||||
|
bottom: 6%;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
#info-wrapper .sidebar.affixable.affix-top {
|
#info-wrapper .sidebar.affixable.affix-top {
|
||||||
position: relative !important;
|
position: relative !important;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue