Allow user to add a comment to a request for movies/tv shows then display this in requests table.

This commit is contained in:
Ryan Castles 2023-04-23 16:40:39 +10:00
commit 165920291f
22 changed files with 133 additions and 92 deletions

View file

@ -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
};
}

View file

@ -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; }
}
}

View file

@ -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]

View file

@ -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; }
}
}

View file

@ -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;

View file

@ -212,4 +212,5 @@ export class BaseRequestOptions {
requestOnBehalf: string | undefined;
rootFolderOverride: number | undefined;
qualityPathOverride: number | undefined;
comment: string | undefined;
}

View file

@ -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;

View file

@ -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);

View file

@ -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">

View file

@ -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;

View file

@ -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">

View file

@ -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";

View file

@ -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 -->

View file

@ -5,4 +5,8 @@
background: $accent;
border-color: $ombi-background-primary;
color:white;
}
.comment-box {
resize: none;
}

View file

@ -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],

View file

@ -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);

View file

@ -310,90 +310,91 @@
"CompletedVotesTab": "Гласувано",
"VotesTab": "Трябват гласове"
},
"MediaDetails": {
"Denied": "Отказано",
"Denied4K": "Denied 4K",
"Trailers": "Trailers",
"RecommendationsTitle": "Препоръчани",
"SimilarTitle": "Подобни",
"VideosTitle": "Видеоклипове",
"AlbumsTitle": "Албуми",
"RequestAllAlbums": "Заявете всички албуми",
"ClearSelection": "Изчистване на избора",
"RequestSelectedAlbums": "Заявете избраните албуми",
"ViewCollection": "Преглед на колекцията",
"NotEnoughInfo": "За съжаление все още няма достатъчно информация за това предаване!",
"AdvancedOptions": "Разширени настройки",
"AutoApproveOptions": "You can configure the request here, once requested it will be sent to your DVR application and will be auto approved! Please note, this is optional, just press Request to skip!",
"AutoApproveOptionsTv": "You can configure the request here, once requested it will be sent to your DVR application and will be auto approved! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it! Please note, this is optional, just press Request to skip!",
"AutoApproveOptionsTvShort": "You can configure the request here, once requested it will be sent to your DVR application! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it! Please note, this is optional, just press Request to skip!",
"QualityProfilesSelect": "Изберете профил на качеството",
"RootFolderSelect": "Изберете основна папка",
"LanguageProfileSelect": "Изберете езиков профил",
"Status": "Състояние:",
"StatusValues": {
"Rumored": "Rumored",
"Planned": "Planned",
"In Production": "In Production",
"Post Production": "Post Production",
"Released": "Released",
"Running": "Running",
"Returning Series": "Returning Series",
"Ended": "Ended",
"Canceled": "Canceled"
},
"Seasons": "Seasons:",
"Episodes": "Episodes:",
"Availability": "Наличност:",
"RequestStatus": "Request Status:",
"Quality": "Качество:",
"RootFolderOverride": "Ръчно задаване на основната папка:",
"QualityOverride": "Ръчно задаване на качеството:",
"Network": "Мрежа:",
"GenresLabel": "Жанрове:",
"Genres": "Жанрове",
"FirstAired": "Първо излъчено:",
"TheatricalRelease": "Кино премиера:",
"DigitalRelease": "Дигитална версия:",
"Votes": "Гласове:",
"Runtime": "Продължителност:",
"Minutes": "{{runtime}} Минути",
"Revenue": "Приходи:",
"Budget": "Бюджет:",
"Keywords": "Ключови думи/тагове:",
"Casts": {
"CastTitle": "В ролите"
},
"Crews": {
"CrewTitle": "Crew"
},
"EpisodeSelector": {
"AllSeasonsTooltip": "Това ще заяви всеки сезон на това предаване",
"FirstSeasonTooltip": "Това ще заяви само първия сезон на това предаване",
"LatestSeasonTooltip": "Това ще заяви само последния сезон на това предаване",
"NoEpisodes": "За съжаление все още няма данни за епизоди на това предаване!",
"SeasonNumber": "Сезон {{number}}"
},
"SonarrConfiguration": "Конфигурация на Sonarr",
"RadarrConfiguration": "Конфигурация на Radarr",
"RequestOnBehalf": "Заявете от името на",
"PleaseSelectUser": "Моля, изберете потребител",
"StreamingOn": "Поточното изпълнение е включено:",
"RequestedBy": "Заявено от:",
"OnDate": "On:",
"RequestedByOn": "Requested By {{user}} on {{date}}",
"RequestDate": "Дата на заявка:",
"DeniedReason": "Причина за отхвърляне:",
"ReProcessRequest": "Повтаряне на заявка",
"ReProcessRequest4K": "Re-Process 4K Request",
"Music": {
"Type": "Type:",
"Country": "Country:",
"StartDate": "Start Date:",
"EndDate": "EndDate:"
},
"RequestSource": "Source:"
"MediaDetails": {
"Denied": "Отказано",
"Denied4K": "Denied 4K",
"Trailers": "Trailers",
"RecommendationsTitle": "Препоръчани",
"SimilarTitle": "Подобни",
"VideosTitle": "Видеоклипове",
"AlbumsTitle": "Албуми",
"RequestAllAlbums": "Заявете всички албуми",
"ClearSelection": "Изчистване на избора",
"RequestSelectedAlbums": "Заявете избраните албуми",
"ViewCollection": "Преглед на колекцията",
"NotEnoughInfo": "За съжаление все още няма достатъчно информация за това предаване!",
"AdvancedOptions": "Разширени настройки",
"AutoApproveOptions": "You can configure the request here, once requested it will be sent to your DVR application and will be auto approved! Please note, this is optional, just press Request to skip!",
"AutoApproveOptionsTv": "You can configure the request here, once requested it will be sent to your DVR application and will be auto approved! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it! Please note, this is optional, just press Request to skip!",
"AutoApproveOptionsTvShort": "You can configure the request here, once requested it will be sent to your DVR application! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it! Please note, this is optional, just press Request to skip!",
"QualityProfilesSelect": "Изберете профил на качеството",
"RootFolderSelect": "Изберете основна папка",
"LanguageProfileSelect": "Изберете езиков профил",
"Status": "Състояние:",
"StatusValues": {
"Rumored": "Rumored",
"Planned": "Planned",
"In Production": "In Production",
"Post Production": "Post Production",
"Released": "Released",
"Running": "Running",
"Returning Series": "Returning Series",
"Ended": "Ended",
"Canceled": "Canceled"
},
"Seasons": "Seasons:",
"Episodes": "Episodes:",
"Availability": "Наличност:",
"RequestStatus": "Request Status:",
"Quality": "Качество:",
"RootFolderOverride": "Ръчно задаване на основната папка:",
"QualityOverride": "Ръчно задаване на качеството:",
"Network": "Мрежа:",
"GenresLabel": "Жанрове:",
"Genres": "Жанрове",
"FirstAired": "Първо излъчено:",
"TheatricalRelease": "Кино премиера:",
"DigitalRelease": "Дигитална версия:",
"Votes": "Гласове:",
"Runtime": "Продължителност:",
"Minutes": "{{runtime}} Минути",
"Revenue": "Приходи:",
"Budget": "Бюджет:",
"Keywords": "Ключови думи/тагове:",
"Casts": {
"CastTitle": "В ролите"
},
"Crews": {
"CrewTitle": "Crew"
},
"EpisodeSelector": {
"AllSeasonsTooltip": "Това ще заяви всеки сезон на това предаване",
"FirstSeasonTooltip": "Това ще заяви само първия сезон на това предаване",
"LatestSeasonTooltip": "Това ще заяви само последния сезон на това предаване",
"NoEpisodes": "За съжаление все още няма данни за епизоди на това предаване!",
"SeasonNumber": "Сезон {{number}}"
},
"SonarrConfiguration": "Конфигурация на Sonarr",
"RadarrConfiguration": "Конфигурация на Radarr",
"RequestOnBehalf": "Заявете от името на",
"PleaseSelectUser": "Моля, изберете потребител",
"AddComment": "Добавить комментарий",
"StreamingOn": "Поточното изпълнение е включено:",
"RequestedBy": "Заявено от:",
"OnDate": "On:",
"RequestedByOn": "Requested By {{user}} on {{date}}",
"RequestDate": "Дата на заявка:",
"DeniedReason": "Причина за отхвърляне:",
"ReProcessRequest": "Повтаряне на заявка",
"ReProcessRequest4K": "Re-Process 4K Request",
"Music": {
"Type": "Type:",
"Country": "Country:",
"StartDate": "Start Date:",
"EndDate": "EndDate:"
},
"RequestSource": "Source:"
},
"Discovery": {
"PopularTab": "Популярни",
"TrendingTab": "Актуални",

View file

@ -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:",

View file

@ -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:",

View file

@ -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:",

View file

@ -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:",

View file

@ -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:",