Skip to content

Allow user to add a comment to a request for movies/tv shows then dis… #4913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Ombi.Core/Engine/MovieRequestEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public async Task<RequestEngineResult> RequestMovie(MovieRequestViewModel model)
QualityOverride = model.QualityPathOverride.GetValueOrDefault(),
RequestedDate4k = model.Is4kRequest ? DateTime.UtcNow : DateTime.MinValue,
Is4kRequest = model.Is4kRequest,
Source = model.Source
Source = model.Source,
Comment = model.Comment
};
}

Expand Down
2 changes: 2 additions & 0 deletions src/Ombi.Core/Models/Requests/BaseRequestOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ public class BaseRequestOptions
public string RequestOnBehalf { get; set; }
public int? RootFolderOverride { get; set; }
public int? QualityPathOverride { get; set; }

public string Comment { get; set; }
}
}
1 change: 1 addition & 0 deletions src/Ombi.Store/Entities/Requests/BaseRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class BaseRequest : Entity
public OmbiUser RequestedUser { get; set; }

public RequestSource Source { get; set; } = RequestSource.Ombi;
public string Comment { get; set; }


[NotMapped]
Expand Down
2 changes: 2 additions & 0 deletions src/Ombi.Store/Entities/Requests/TvRequests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ public class TvRequests : Entity
public int TotalSeasons { get; set; }

public List<ChildRequests> ChildRequests { get; set; }
public string Comment { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -146,6 +146,7 @@ export class DiscoverCardComponent implements OnInit {
qualityPathOverride: null,
rootFolderOverride: null,
is4KRequest: is4k,
comment: comment
};

if (!this.isAdmin) {
Expand All @@ -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",
}
);
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,5 @@ export class BaseRequestOptions {
requestOnBehalf: string | undefined;
rootFolderOverride: number | undefined;
qualityPathOverride: number | undefined;
comment: string | undefined;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ <h3><i class="fas fa-user-friends"></i> {{'MediaDetails.RequestOnBehalf' | trans
</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 -->


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
background: $accent;
border-color: $ombi-background-primary;
color:white;
}

.comment-box {
resize: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface IAdminRequestDialogData {
type: RequestType;
id: number;
is4k: boolean | null;
comment: string | null;
}

@Component({
Expand Down Expand Up @@ -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],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface EpisodeRequestData {
series: ISearchTvResultV2;
isAdmin: boolean;
requestOnBehalf: string | undefined;
comment: string | undefined;
}
@Component({
selector: "episode-request",
Expand Down Expand Up @@ -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);
Expand Down
167 changes: 84 additions & 83 deletions src/Ombi/wwwroot/translations/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Актуални",
Expand Down
Loading