Fixed up the episode request modal a bit

pull/3895/head
Jamie Rees 5 years ago
parent 63b93561e3
commit 619e22827f

@ -9,7 +9,7 @@ namespace Ombi.Helpers
{
const string mutexId = "Global\\OMBI";
using (var mutex = new Mutex(false, mutexId, out __))
using (var mutex = new Mutex(false, mutexId, out var __))
{
var hasHandle = false;
try

@ -51,7 +51,7 @@ export class TvDetailsComponent {
}
public async request() {
this.dialog.open(EpisodeRequestComponent, { width: "700px", data: this.tv })
this.dialog.open(EpisodeRequestComponent, { width: "800px", data: this.tv })
}
public openDialog() {

@ -1,73 +1,83 @@
<div class="spinner-container">
<mat-spinner *ngIf="loading" [color]="'accent'"></mat-spinner>
<mat-spinner *ngIf="loading" [color]="'accent'"></mat-spinner>
</div>
<div *ngIf="!loading" mat-dialog-content class="background">
<div class="row">
<div class="col-12" *ngFor="let season of series.seasonRequests">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-checkbox *ngIf="!season.seasonAvailable" (click)="$event.stopPropagation();" (change)="seasonChanged($event, season)"> Season {{season.seasonNumber}}</mat-checkbox>
<span *ngIf="season.seasonAvailable">Season {{season.seasonNumber}}</span>
</mat-panel-title>
<mat-panel-description>
Description
</mat-panel-description>
</mat-expansion-panel-header>
<div class="row">
<div class="col-12 action-buttons-right">
<button (click)="requestAllSeasons()" color="primary" mat-raised-button class="btn-spacing"
matTooltip="{{'MediaDetails.EpisodeSelector.AllSeasonsTooltip' | translate}}">{{'Search.TvShows.AllSeasons' | translate }}</button>
<div class="row" *ngFor="let ep of season.episodes">
<div class="col-1">
<div *ngIf="!ep.available && !ep.requested && !ep.approved">
<mat-checkbox *ngIf="!ep.selected" [ngModel]="ep.selected" (click)="addRequest(ep)"></mat-checkbox>
<mat-checkbox *ngIf="ep.selected" [ngModel]="ep.selected" (click)="removeRequest(ep)"></mat-checkbox>
</div>
</div>
<div class="col-1">
{{ep.episodeNumber}}
</div>
<div class="col-3">
{{ep.title}}
</div>
<div class="col-2" *ngIf="ep.airDateDisplay != 'Unknown'">
{{ep.airDate | amLocal | amDateFormat: 'L' }}
</div>
<div class="col-2" *ngIf="ep.airDateDisplay == 'Unknown'">
{{ep.airDateDisplay }}
</div>
<div class="col-3">
<ng-template [ngIf]="ep.available"><span class="label label-success"
id="availableLabel">Available</span></ng-template>
<ng-template [ngIf]="ep.approved && !ep.available "><span class="label label-info"
id="processingRequestLabel">Processing Request</span></ng-template>
<ng-template [ngIf]="ep.selected"><span class="label label-info"
id="selectedLabel">Selected</span></ng-template>
<ng-template [ngIf]="ep.requested && !ep.approved && !ep.available && !ep.selected"><span
class="label label-warning" id="pendingApprovalLabel">Pending Approval</span>
</ng-template>
<ng-template [ngIf]="!ep.requested && !ep.available && !ep.approved && !ep.selected"><span
class="label label-danger" id="notRequetsedLabel">Not Requested</span></ng-template>
</div>
<button (click)="requestFirstSeason()" color="accent" mat-raised-button class="btn-spacing"
matTooltip="{{'MediaDetails.EpisodeSelector.FirstSeasonTooltip' | translate}}">{{ 'Search.TvShows.FirstSeason' | translate }}</button>
<button (click)="requestLatestSeason()" color="warn" mat-raised-button class="btn-spacing"
matTooltip="{{'MediaDetails.EpisodeSelector.LatestSeasonTooltip' | translate}}">{{ 'Search.TvShows.LatestSeason' | translate }}</button>
</div>
</div>
</div>
<div class="row">
<div class="col-12" *ngFor="let season of series.seasonRequests">
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
<mat-checkbox *ngIf="!season.seasonAvailable" (click)="$event.stopPropagation();" (change)="seasonChanged($event, season)">
Season {{season.seasonNumber}}</mat-checkbox>
<span *ngIf="season.seasonAvailable">Season {{season.seasonNumber}}</span>
</mat-panel-title>
<mat-panel-description>
Description
</mat-panel-description>
</mat-expansion-panel-header>
<div class="row" *ngFor="let ep of season.episodes">
<div class="col-1">
<div *ngIf="!ep.available && !ep.requested && !ep.approved">
<mat-checkbox *ngIf="!ep.selected" [ngModel]="ep.selected" (click)="addRequest(ep)"></mat-checkbox>
<mat-checkbox *ngIf="ep.selected" [ngModel]="ep.selected" (click)="removeRequest(ep)"></mat-checkbox>
</div>
</div>
<div class="col-1">
{{ep.episodeNumber}}
</div>
<div class="col-3">
{{ep.title}}
</div>
<div class="col-2" *ngIf="ep.airDateDisplay != 'Unknown'">
{{ep.airDate | amLocal | amDateFormat: 'L' }}
</div>
<div class="col-2" *ngIf="ep.airDateDisplay == 'Unknown'">
{{ep.airDateDisplay }}
</div>
<div class="col-3">
<ng-template [ngIf]="ep.available"><span class="label label-success" id="availableLabel">Available</span></ng-template>
<ng-template [ngIf]="ep.approved && !ep.available "><span class="label label-info" id="processingRequestLabel">Processing
Request</span></ng-template>
<ng-template [ngIf]="ep.selected"><span class="label label-info" id="selectedLabel">Selected</span></ng-template>
<ng-template [ngIf]="ep.requested && !ep.approved && !ep.available && !ep.selected"><span class="label label-warning"
id="pendingApprovalLabel">Pending Approval</span>
</ng-template>
<ng-template [ngIf]="!ep.requested && !ep.available && !ep.approved && !ep.selected"><span class="label label-danger"
id="notRequetsedLabel">Not Requested</span></ng-template>
</div>
</mat-expansion-panel>
</div>
</mat-expansion-panel>
</div>
</div>
</div>
</div>
<div mat-dialog-actions>
<div class="action-buttons-right">
<div class="col-md-12">
<button (click)="submitRequests()" mat-raised-button class="btn-spacing btn-orange">{{
'Common.Request' | translate }}</button>
<div class="action-buttons-right">
<button (click)="submitRequests()" mat-raised-button class="btn-spacing btn-orange">{{
'Common.Request' | translate }}</button>
</div>
</div>
</div>
</div>
</div>

@ -29,8 +29,8 @@ export class EpisodeRequestComponent implements OnInit {
return ep.selected;
});
});
if (!selected) {
debugger;
if (!selected && !this.series.requestAll && !this.series.firstSeason && !this.series.latestSeason) {
this.notificationService.send("You need to select some episodes!", "OK");
return;
}
@ -41,15 +41,14 @@ export class EpisodeRequestComponent implements OnInit {
viewModel.seasons = [];
this.series.seasonRequests.forEach((season) => {
const seasonsViewModel = <ISeasonsViewModel>{ seasonNumber: season.seasonNumber, episodes: [] };
season.episodes.forEach(ep => {
if (!this.series.latestSeason || !this.series.requestAll || !this.series.firstSeason) {
if (!this.series.latestSeason && !this.series.requestAll && !this.series.firstSeason) {
season.episodes.forEach(ep => {
if (ep.selected) {
ep.requested = true;
seasonsViewModel.episodes.push({ episodeNumber: ep.episodeNumber });
}
}
});
});
}
viewModel.seasons.push(seasonsViewModel);
});
@ -81,11 +80,26 @@ export class EpisodeRequestComponent implements OnInit {
public seasonChanged(checkbox: MatCheckboxChange, season: INewSeasonRequests) {
season.episodes.forEach((ep) => {
if (checkbox.checked) {
if (checkbox.checked && (!ep.available && !ep.requested && !ep.approved)) {
this.addRequest(ep)
} else {
this.removeRequest(ep);
}
});
}
public async requestAllSeasons() {
this.series.requestAll = true;
await this.submitRequests();
}
public async requestFirstSeason() {
this.series.firstSeason = true;
await this.submitRequests();
}
public async requestLatestSeason() {
this.series.latestSeason = true;
await this.submitRequests();
}
}

@ -43,6 +43,7 @@ import { EpisodeRequestComponent } from "./episode-request/episode-request.compo
TranslateModule,
MatExpansionModule,
MatDialogModule,
MatTooltipModule,
],
entryComponents: [
EpisodeRequestComponent

@ -17,14 +17,14 @@
"NotAvailable": "Not Available",
"ProcessingRequest": "Processing Request",
"PendingApproval": "Pending Approval",
"RequestDenied":"Request Denied",
"RequestDenied": "Request Denied",
"NotRequested": "Not Requested",
"Requested": "Requested",
"Request": "Request",
"Denied":"Denied",
"Approve":"Approve",
"Denied": "Denied",
"Approve": "Approve",
"PartlyAvailable": "Partly Available",
"ViewDetails": "View Details",
"ViewDetails": "View Details",
"Errors": {
"Validation": "Please check your entered values"
}
@ -38,49 +38,45 @@
"OnlineParagraph": "The media server is currently online",
"PartiallyOnlineHeading": "Partially Online",
"PartiallyOnlineParagraph": "The media server is partially online.",
"MultipleServersUnavailable":
"There are {{serversUnavailable}} servers offline out of {{totalServers}}.",
"SingleServerUnavailable":
"There is {{serversUnavailable}} server offline out of {{totalServers}}.",
"MultipleServersUnavailable": "There are {{serversUnavailable}} servers offline out of {{totalServers}}.",
"SingleServerUnavailable": "There is {{serversUnavailable}} server offline out of {{totalServers}}.",
"OfflineHeading": "Currently Offline",
"OfflineParagraph": "The media server is currently offline.",
"CheckPageForUpdates": "Check this page for continuous site updates."
},
"NavigationBar": {
"Discover":"Discover",
"Discover": "Discover",
"Search": "Search",
"Requests": "Requests",
"UserManagement": "User Management",
"Issues":"Issues",
"Vote":"Vote",
"Issues": "Issues",
"Vote": "Vote",
"Donate": "Donate!",
"DonateLibraryMaintainer": "Donate to Library Maintainer",
"DonateTooltip":
"This is how I convince my wife to let me spend my spare time developing Ombi ;)",
"DonateTooltip": "This is how I convince my wife to let me spend my spare time developing Ombi ;)",
"UpdateAvailableTooltip": "Update Available!",
"Settings": "Settings",
"Welcome": "Welcome {{username}}",
"UpdateDetails": "Update Details",
"Logout": "Logout",
"OpenMobileApp":"Open Mobile App",
"RecentlyAdded":"Recently Added"
"OpenMobileApp": "Open Mobile App",
"RecentlyAdded": "Recently Added"
},
"Search": {
"Title": "Search",
"Paragraph":
"Want to watch something that is not currently available? No problem, just search for it below and request it!",
"Paragraph": "Want to watch something that is not currently available? No problem, just search for it below and request it!",
"MoviesTab": "Movies",
"TvTab": "TV Shows",
"MusicTab":"Music",
"MusicTab": "Music",
"Suggestions": "Suggestions",
"NoResults": "Sorry, we didn't find any results!",
"DigitalDate": "Digital Release: {{date}}",
"TheatricalRelease":"Theatrical Release: {{date}}",
"TheatricalRelease": "Theatrical Release: {{date}}",
"ViewOnPlex": "View On Plex",
"ViewOnEmby": "View On Emby",
"RequestAdded": "Request for {{title}} has been added successfully",
"Similar":"Similar",
"Refine":"Refine",
"Similar": "Similar",
"Refine": "Refine",
"Movies": {
"PopularMovies": "Popular Movies",
"UpcomingMovies": "Upcoming Movies",
@ -90,28 +86,27 @@
"Trailer": "Trailer"
},
"TvShows": {
"Popular":"Popular",
"Trending":"Trending",
"MostWatched":"Most Watched",
"MostAnticipated":"Most Anticipated",
"Results":"Results",
"AirDate":"Air Date:",
"AllSeasons":"All Seasons",
"FirstSeason":"First Season",
"LatestSeason":"Latest Season",
"Select":"Select ...",
"SubmitRequest":"Submit Request",
"Season":"Season: {{seasonNumber}}",
"SelectAllInSeason":"Select All in Season {{seasonNumber}}"
"Popular": "Popular",
"Trending": "Trending",
"MostWatched": "Most Watched",
"MostAnticipated": "Most Anticipated",
"Results": "Results",
"AirDate": "Air Date:",
"AllSeasons": "All Seasons",
"FirstSeason": "First Season",
"LatestSeason": "Latest Season",
"Select": "Select ...",
"SubmitRequest": "Submit Request",
"Season": "Season: {{seasonNumber}}",
"SelectAllInSeason": "Select All in Season {{seasonNumber}}"
}
},
"Requests": {
"Title": "Requests",
"Paragraph":
"Below you can see yours and all other requests, as well as their download and approval status.",
"Paragraph": "Below you can see yours and all other requests, as well as their download and approval status.",
"MoviesTab": "Movies",
"TvTab": "TV Shows",
"MusicTab":"Music",
"MusicTab": "Music",
"RequestedBy": "Requested By:",
"Status": "Status:",
"RequestStatus": "Request status:",
@ -123,27 +118,27 @@
"RequestDate": "Request Date:",
"QualityOverride": "Quality Override:",
"RootFolderOverride": "Root Folder Override:",
"ChangeRootFolder":"Root Folder",
"ChangeQualityProfile":"Quality Profile",
"MarkUnavailable":"Mark Unavailable",
"MarkAvailable":"Mark Available",
"Remove":"Remove",
"Deny":"Deny",
"DenyReason":"Deny Reason",
"Season":"Season:",
"GridTitle":"Title",
"AirDate":"AirDate",
"GridStatus":"Status",
"ReportIssue":"Report Issue",
"Filter":"Filter",
"Sort":"Sort",
"SeasonNumberHeading":"Season: {seasonNumber}",
"SortTitleAsc":"Title ▲",
"SortTitleDesc":"Title ▼",
"ChangeRootFolder": "Root Folder",
"ChangeQualityProfile": "Quality Profile",
"MarkUnavailable": "Mark Unavailable",
"MarkAvailable": "Mark Available",
"Remove": "Remove",
"Deny": "Deny",
"DenyReason": "Deny Reason",
"Season": "Season:",
"GridTitle": "Title",
"AirDate": "AirDate",
"GridStatus": "Status",
"ReportIssue": "Report Issue",
"Filter": "Filter",
"Sort": "Sort",
"SeasonNumberHeading": "Season: {seasonNumber}",
"SortTitleAsc": "Title ▲",
"SortTitleDesc": "Title ▼",
"SortRequestDateAsc": "Request Date ▲",
"SortRequestDateDesc": "Request Date ▼",
"SortStatusAsc":"Status ▲",
"SortStatusDesc":"Status ▼",
"SortStatusAsc": "Status ▲",
"SortStatusDesc": "Status ▼",
"Remaining": {
"Quota": "{{remaining}}/{{total}} requests remaining",
"NextDays": "Another request will be added in {{time}} days",
@ -152,30 +147,30 @@
"NextMinute": "Another request will be added in {{time}} minute"
}
},
"Issues":{
"Title":"Issues",
"PendingTitle":"Pending Issues",
"InProgressTitle":"In Progress Issues",
"ResolvedTitle":"Resolved Issues",
"ColumnTitle":"Title",
"Category":"Category",
"Issues": {
"Title": "Issues",
"PendingTitle": "Pending Issues",
"InProgressTitle": "In Progress Issues",
"ResolvedTitle": "Resolved Issues",
"ColumnTitle": "Title",
"Category": "Category",
"Status": "Status",
"Details": "Details",
"Description":"Description",
"NoComments":"No Comments!",
"MarkInProgress":"Mark In Progress",
"MarkResolved":"Mark Resolved",
"SendMessageButton":"Send",
"Subject":"Subject",
"Comments":"Comments",
"WriteMessagePlaceholder":"Write your message here...",
"ReportedBy":"Reported By"
"Description": "Description",
"NoComments": "No Comments!",
"MarkInProgress": "Mark In Progress",
"MarkResolved": "Mark Resolved",
"SendMessageButton": "Send",
"Subject": "Subject",
"Comments": "Comments",
"WriteMessagePlaceholder": "Write your message here...",
"ReportedBy": "Reported By"
},
"Filter":{
"ClearFilter":"Clear Filter",
"FilterHeaderAvailability":"Availability",
"FilterHeaderRequestStatus":"Status",
"Approved":"Approved",
"Filter": {
"ClearFilter": "Clear Filter",
"FilterHeaderAvailability": "Availability",
"FilterHeaderRequestStatus": "Status",
"Approved": "Approved",
"PendingApproval": "Pending Approval"
},
"UserManagment": {
@ -192,30 +187,35 @@
},
"MediaDetails": {
"Denied": "Denied",
"RecommendationsTitle":"Recommendations",
"SimilarTitle":"Similar",
"VideosTitle":"Videos",
"RecommendationsTitle": "Recommendations",
"SimilarTitle": "Similar",
"VideosTitle": "Videos",
"Casts": {
"CastTitle":"Cast",
"Character":"Character",
"Actor":"Actor"
"CastTitle": "Cast",
"Character": "Character",
"Actor": "Actor"
},
"Discovery": {
"PopularTab":"Popular",
"TrendingTab":"Trending",
"UpcomingTab":"Upcoming",
"CardDetails":{
"Availability":"Availability",
"Studio":"Studio",
"Network":"Network",
"UnknownNetwork":"Unknown",
"RequestStatus":"Request Status",
"Director":"Director",
"InCinemas":"In Cinemas",
"FirstAired":"First Aired",
"Writer":"Writer",
"ExecProducer":"Exec Producer"
}
"EpisodeSelector":{
"AllSeasonsTooltip":"This will request every season for this show",
"FirstSeasonTooltip":"This will only request the First Season for this show",
"LatestSeasonTooltip":"This will only request the Latest Season for this show"
}
},
"Discovery": {
"PopularTab": "Popular",
"TrendingTab": "Trending",
"UpcomingTab": "Upcoming",
"CardDetails": {
"Availability": "Availability",
"Studio": "Studio",
"Network": "Network",
"UnknownNetwork": "Unknown",
"RequestStatus": "Request Status",
"Director": "Director",
"InCinemas": "In Cinemas",
"FirstAired": "First Aired",
"Writer": "Writer",
"ExecProducer": "Exec Producer"
}
}
}

Loading…
Cancel
Save