diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.html index 53335f435..eb1283440 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-request-grid/tv-request-grid.component.html @@ -76,16 +76,3 @@ --> - - - - - - - - - - diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html index 4661c9f6a..7240366ae 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.html @@ -229,6 +229,17 @@ + + + + + + + +
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts index fc42f1c4e..d085ad4c4 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/tv-details.component.ts @@ -13,6 +13,7 @@ import { TvAdvancedOptionsComponent } from "./panels/tv-advanced-options/tv-adva import { RequestServiceV2 } from "../../../services/requestV2.service"; import { forkJoin } from "rxjs"; import { SonarrFacade } from "app/state/sonarr"; +import { ITvRequestViewModelV2 } from "../../../interfaces/ISearchTvResult"; @Component({ 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)); } + // 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 = { + 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() { if (this.tv.images.original == null) { this.tv.images.original = "../../../images/default_movie_poster.png"; diff --git a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss index 196a8f93a..8d3ce8c4a 100644 --- a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss +++ b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss @@ -99,6 +99,14 @@ 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 { position: relative !important; }