mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-24 06:55:23 -07:00
Allow user to add a comment to a request for movies/tv shows then display this in requests table.
This commit is contained in:
parent
a70e9403c7
commit
165920291f
22 changed files with 133 additions and 92 deletions
|
@ -145,7 +145,8 @@ namespace Ombi.Core.Engine
|
|||
QualityOverride = model.QualityPathOverride.GetValueOrDefault(),
|
||||
RequestedDate4k = model.Is4kRequest ? DateTime.UtcNow : DateTime.MinValue,
|
||||
Is4kRequest = model.Is4kRequest,
|
||||
Source = model.Source
|
||||
Source = model.Source,
|
||||
Comment = model.Comment
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -35,5 +35,7 @@ namespace Ombi.Core.Models.Requests
|
|||
public string RequestOnBehalf { get; set; }
|
||||
public int? RootFolderOverride { get; set; }
|
||||
public int? QualityPathOverride { get; set; }
|
||||
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
|
@ -23,6 +23,7 @@ namespace Ombi.Store.Entities.Requests
|
|||
public OmbiUser RequestedUser { get; set; }
|
||||
|
||||
public RequestSource Source { get; set; } = RequestSource.Ombi;
|
||||
public string Comment { get; set; }
|
||||
|
||||
|
||||
[NotMapped]
|
||||
|
|
|
@ -27,5 +27,7 @@ namespace Ombi.Store.Entities.Requests
|
|||
public int TotalSeasons { get; set; }
|
||||
|
||||
public List<ChildRequests> ChildRequests { get; set; }
|
||||
public string Comment { get; set; }
|
||||
|
||||
}
|
||||
}
|
|
@ -126,7 +126,7 @@ export class DiscoverCardComponent implements OnInit {
|
|||
return "";
|
||||
}
|
||||
|
||||
public request(event: any, is4k: boolean) {
|
||||
public request(event: any, is4k: boolean, comment: string) {
|
||||
event.preventDefault();
|
||||
this.loading = true;
|
||||
switch (this.result.type) {
|
||||
|
@ -146,6 +146,7 @@ export class DiscoverCardComponent implements OnInit {
|
|||
qualityPathOverride: null,
|
||||
rootFolderOverride: null,
|
||||
is4KRequest: is4k,
|
||||
comment: comment
|
||||
};
|
||||
|
||||
if (!this.isAdmin) {
|
||||
|
@ -157,7 +158,7 @@ export class DiscoverCardComponent implements OnInit {
|
|||
AdminRequestDialogComponent,
|
||||
{
|
||||
width: "700px",
|
||||
data: { type: RequestType.movie, id: this.result.id, is4k: is4k },
|
||||
data: { type: RequestType.movie, id: this.result.id, is4k: is4k, comment: comment },
|
||||
panelClass: "modal-panel",
|
||||
}
|
||||
);
|
||||
|
@ -170,6 +171,8 @@ export class DiscoverCardComponent implements OnInit {
|
|||
movieRequest.requestOnBehalf = result.username?.id;
|
||||
movieRequest.qualityPathOverride = result.radarrPathId;
|
||||
movieRequest.rootFolderOverride = result.radarrFolderId;
|
||||
movieRequest.comment = result.comment;
|
||||
|
||||
this.requestMovie(movieRequest);
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -212,4 +212,5 @@ export class BaseRequestOptions {
|
|||
requestOnBehalf: string | undefined;
|
||||
rootFolderOverride: number | undefined;
|
||||
qualityPathOverride: number | undefined;
|
||||
comment: string | undefined;
|
||||
}
|
|
@ -106,7 +106,7 @@ export class MovieDetailsComponent implements OnInit{
|
|||
}
|
||||
}
|
||||
|
||||
public async request(is4K: boolean, userId?: string) {
|
||||
public async request(is4K: boolean, userId?: string, comment?: string) {
|
||||
if (!this.is4KEnabled) {
|
||||
is4K = false;
|
||||
}
|
||||
|
@ -119,7 +119,8 @@ export class MovieDetailsComponent implements OnInit{
|
|||
qualityPathOverride: result.radarrPathId,
|
||||
requestOnBehalf: result.username?.id,
|
||||
rootFolderOverride: result.radarrFolderId,
|
||||
is4KRequest: is4K }));
|
||||
is4KRequest: is4K,
|
||||
comment: result.comment }));
|
||||
if (requestResult.result) {
|
||||
if (is4K) {
|
||||
this.movie.has4KRequest = true;
|
||||
|
@ -135,7 +136,7 @@ export class MovieDetailsComponent implements OnInit{
|
|||
}
|
||||
});
|
||||
} else {
|
||||
const result = await firstValueFrom(this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, languageCode: this.translate.currentLang, requestOnBehalf: userId, qualityPathOverride: undefined, rootFolderOverride: undefined, is4KRequest: is4K }));
|
||||
const result = await firstValueFrom(this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, languageCode: this.translate.currentLang, requestOnBehalf: userId, qualityPathOverride: undefined, rootFolderOverride: undefined, is4KRequest: is4K, comment: comment }));
|
||||
if (result.result) {
|
||||
if (is4K) {
|
||||
this.movie.has4KRequest = true;
|
||||
|
|
|
@ -25,7 +25,7 @@ export class TvRequestGridComponent {
|
|||
return this.tv?.seasonRequests?.length > 0
|
||||
}
|
||||
|
||||
public displayedColumns: string[] = ['select', 'number', 'title', 'airDate', 'status'];
|
||||
public displayedColumns: string[] = ['select', 'number', 'title', 'airDate','status'];
|
||||
|
||||
constructor(private requestService: RequestService, private requestServiceV2: RequestServiceV2, private notificationService: MessageService,
|
||||
private dialog: MatDialog, private translate: TranslateService) {
|
||||
|
@ -69,6 +69,7 @@ export class TvRequestGridComponent {
|
|||
viewModel.qualityPathOverride = result?.sonarrPathId;
|
||||
viewModel.rootFolderOverride = result?.sonarrFolderId;
|
||||
viewModel.languageProfile = result?.sonarrLanguageId;
|
||||
//viewModel.comment = result?.comment;
|
||||
|
||||
const requestResult = await this.requestServiceV2.requestTv(viewModel).toPromise();
|
||||
this.postRequest(requestResult);
|
||||
|
|
|
@ -66,6 +66,11 @@
|
|||
<td mat-cell id="status{{element.id}}" *matCellDef="let element"> {{element.status |translateStatus }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="comment">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'Requests.Comment' | translate}} </th>
|
||||
<td mat-cell id="requestedBy{{element.id}}" *matCellDef="let element"> {{element.comment}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="has4kRequest">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> {{ 'Requests.Has4KRequest' | translate}} </th>
|
||||
<td mat-cell id="has4kRequest{{element.id}}" *matCellDef="let element">
|
||||
|
|
|
@ -24,7 +24,7 @@ export class MoviesGridComponent implements OnInit, AfterViewInit {
|
|||
public dataSource: MatTableDataSource<IMovieRequests>;
|
||||
public resultsLength: number;
|
||||
public isLoadingResults = true;
|
||||
public displayedColumns: string[] = ['title', 'requestedUser.requestedBy', 'status', 'requestStatus','requestedDate', 'actions'];
|
||||
public displayedColumns: string[] = ['title', 'requestedUser.requestedBy', 'status', 'requestStatus','requestedDate', 'comment', 'actions' ];
|
||||
public gridCount: string = "15";
|
||||
public isAdmin: boolean;
|
||||
public is4kEnabled = false;
|
||||
|
|
|
@ -60,6 +60,11 @@
|
|||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="comment">
|
||||
<th mat-header-cell *matHeaderCellDef> {{'Requests.Comment' | translate}} </th>
|
||||
<td mat-cell id="requestedBy{{element.id}}" *matCellDef="let element"> {{element.parentRequest.comment}} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef> </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
|
|
|
@ -19,7 +19,7 @@ export class TvGridComponent implements OnInit, AfterViewInit {
|
|||
public dataSource: IChildRequests[] = [];
|
||||
public resultsLength: number;
|
||||
public isLoadingResults = true;
|
||||
public displayedColumns: string[] = ['series', 'requestedBy', 'status', 'requestStatus', 'requestedDate','actions'];
|
||||
public displayedColumns: string[] = ['series', 'requestedBy', 'status', 'requestStatus', 'requestedDate', 'comment','actions'];
|
||||
public gridCount: string = "15";
|
||||
public isAdmin: boolean;
|
||||
public defaultSort: string = "requestedDate";
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
</mat-option>
|
||||
</mat-autocomplete>
|
||||
</mat-form-field>
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>{{ 'MediaDetails.AddComment' | translate}}</mat-label>
|
||||
<textarea matInput class="comment-box" formControlName="comment"></textarea>
|
||||
</mat-form-field>
|
||||
<!-- End User area -->
|
||||
|
||||
|
||||
|
|
|
@ -6,3 +6,7 @@
|
|||
border-color: $ombi-background-primary;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.comment-box {
|
||||
resize: none;
|
||||
}
|
|
@ -20,6 +20,7 @@ export interface IAdminRequestDialogData {
|
|||
type: RequestType;
|
||||
id: number;
|
||||
is4k: boolean | null;
|
||||
comment: string | null;
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
@ -59,6 +60,7 @@ export class AdminRequestDialogComponent implements OnInit {
|
|||
public async ngOnInit() {
|
||||
this.form = this.fb.group({
|
||||
username: [null],
|
||||
comment: [null],
|
||||
sonarrPathId: [null],
|
||||
sonarrFolderId: [null],
|
||||
sonarrLanguageId: [null],
|
||||
|
|
|
@ -12,6 +12,7 @@ export interface EpisodeRequestData {
|
|||
series: ISearchTvResultV2;
|
||||
isAdmin: boolean;
|
||||
requestOnBehalf: string | undefined;
|
||||
comment: string | undefined;
|
||||
}
|
||||
@Component({
|
||||
selector: "episode-request",
|
||||
|
@ -69,6 +70,7 @@ export class EpisodeRequestComponent {
|
|||
viewModel.qualityPathOverride = result?.sonarrPathId;
|
||||
viewModel.rootFolderOverride = result?.sonarrFolderId;
|
||||
viewModel.languageProfile = result?.sonarrLanguageId;
|
||||
viewModel.comment = result?.comment;
|
||||
|
||||
const requestResult = await this.requestService.requestTv(viewModel).toPromise();
|
||||
this.postRequest(requestResult);
|
||||
|
|
|
@ -378,6 +378,7 @@
|
|||
"RadarrConfiguration": "Конфигурация на Radarr",
|
||||
"RequestOnBehalf": "Заявете от името на",
|
||||
"PleaseSelectUser": "Моля, изберете потребител",
|
||||
"AddComment": "Добавить комментарий",
|
||||
"StreamingOn": "Поточното изпълнение е включено:",
|
||||
"RequestedBy": "Заявено от:",
|
||||
"OnDate": "On:",
|
||||
|
|
|
@ -378,6 +378,7 @@
|
|||
"RadarrConfiguration": "Radarr Configuration",
|
||||
"RequestOnBehalf": "Request on behalf of",
|
||||
"PleaseSelectUser": "Please select a user",
|
||||
"AddComment": "Add a comment",
|
||||
"StreamingOn": "Streamuje na:",
|
||||
"RequestedBy": "Požadováno od:",
|
||||
"OnDate": "On:",
|
||||
|
|
|
@ -165,6 +165,7 @@
|
|||
"TheatricalReleaseSort": "Theatrical Release",
|
||||
"DigitalRelease": "Digital Release: {{date}}",
|
||||
"RequestDate": "Request Date",
|
||||
"Comment": "Comment",
|
||||
"QualityOverride": "Quality Override:",
|
||||
"RootFolderOverride": "Root Folder Override:",
|
||||
"ChangeRootFolder": "Root Folder",
|
||||
|
@ -379,6 +380,7 @@
|
|||
"RadarrConfiguration": "Radarr Configuration",
|
||||
"RequestOnBehalf": "Request on behalf of",
|
||||
"PleaseSelectUser": "Please select a user",
|
||||
"AddComment": "Add a comment",
|
||||
"StreamingOn": "Streaming On:",
|
||||
"RequestedBy": "Requested By:",
|
||||
"OnDate": "On:",
|
||||
|
|
|
@ -378,6 +378,7 @@
|
|||
"RadarrConfiguration": "Radarr Configuration",
|
||||
"RequestOnBehalf": "Request on behalf of",
|
||||
"PleaseSelectUser": "Please select a user",
|
||||
"AddComment": "Add a comment",
|
||||
"StreamingOn": "Streaming On:",
|
||||
"RequestedBy": "Etterspurt av:",
|
||||
"OnDate": "On:",
|
||||
|
|
|
@ -378,6 +378,7 @@
|
|||
"RadarrConfiguration": "Radarr Configuration",
|
||||
"RequestOnBehalf": "Request on behalf of",
|
||||
"PleaseSelectUser": "Please select a user",
|
||||
"AddComment": "Add a comment",
|
||||
"StreamingOn": "Streaming On:",
|
||||
"RequestedBy": "Requested By:",
|
||||
"OnDate": "On:",
|
||||
|
|
|
@ -378,6 +378,7 @@
|
|||
"RadarrConfiguration": "Radarr Configuration",
|
||||
"RequestOnBehalf": "Request on behalf of",
|
||||
"PleaseSelectUser": "Please select a user",
|
||||
"AddComment": "Add a comment",
|
||||
"StreamingOn": "Streaming On:",
|
||||
"RequestedBy": "Автор запроса:",
|
||||
"OnDate": "On:",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue