mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 21:33:15 -07:00
commit
f16c4e0758
17 changed files with 99 additions and 64 deletions
18
src/Ombi.Helpers/NotificationSubstitues.cs
Normal file
18
src/Ombi.Helpers/NotificationSubstitues.cs
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
namespace Ombi.Helpers
|
||||||
|
{
|
||||||
|
public static class NotificationSubstitues
|
||||||
|
{
|
||||||
|
public const string Title = nameof(Title);
|
||||||
|
public const string IssueDescription = nameof(IssueDescription);
|
||||||
|
public const string IssueCategory = nameof(IssueCategory);
|
||||||
|
public const string IssueStatus = nameof(IssueStatus);
|
||||||
|
public const string IssueSubject = nameof(IssueSubject);
|
||||||
|
public const string IssueUser = nameof(IssueUser);
|
||||||
|
public const string IssueUserAlias = nameof(IssueUserAlias);
|
||||||
|
public const string RequestType = nameof(RequestType);
|
||||||
|
public const string PosterPath = nameof(PosterPath);
|
||||||
|
public const string NewIssueComment = nameof(NewIssueComment);
|
||||||
|
public const string IssueId = nameof(IssueId);
|
||||||
|
public const string AdminComment = nameof(AdminComment);
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,7 +39,12 @@ namespace Ombi.Notifications
|
||||||
Year = req?.ReleaseDate.Year.ToString();
|
Year = req?.ReleaseDate.Year.ToString();
|
||||||
Overview = req?.Overview;
|
Overview = req?.Overview;
|
||||||
AdditionalInformation = opts?.AdditionalInformation ?? string.Empty;
|
AdditionalInformation = opts?.AdditionalInformation ?? string.Empty;
|
||||||
|
|
||||||
|
var img = req?.PosterPath ?? string.Empty;
|
||||||
|
if (img.HasValue())
|
||||||
|
{
|
||||||
PosterImage = $"https://image.tmdb.org/t/p/w300/{req?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
PosterImage = $"https://image.tmdb.org/t/p/w300/{req?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
||||||
|
}
|
||||||
CalculateRequestStatus(req);
|
CalculateRequestStatus(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +58,12 @@ namespace Ombi.Notifications
|
||||||
Year = req?.ParentRequest?.ReleaseDate.Year.ToString();
|
Year = req?.ParentRequest?.ReleaseDate.Year.ToString();
|
||||||
Overview = req?.ParentRequest?.Overview;
|
Overview = req?.ParentRequest?.Overview;
|
||||||
AdditionalInformation = opts.AdditionalInformation;
|
AdditionalInformation = opts.AdditionalInformation;
|
||||||
|
var img = req?.ParentRequest?.PosterPath ?? string.Empty;
|
||||||
|
if (img.HasValue())
|
||||||
|
{
|
||||||
PosterImage =
|
PosterImage =
|
||||||
$"https://image.tmdb.org/t/p/w300/{req?.ParentRequest?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
$"https://image.tmdb.org/t/p/w300/{req?.ParentRequest?.PosterPath?.TrimStart('/') ?? string.Empty}";
|
||||||
|
}
|
||||||
|
|
||||||
// Generate episode list.
|
// Generate episode list.
|
||||||
StringBuilder epSb = new StringBuilder();
|
StringBuilder epSb = new StringBuilder();
|
||||||
|
@ -94,16 +103,17 @@ namespace Ombi.Notifications
|
||||||
|
|
||||||
private void LoadIssues(NotificationOptions opts)
|
private void LoadIssues(NotificationOptions opts)
|
||||||
{
|
{
|
||||||
IssueDescription = opts.Substitutes.TryGetValue("IssueDescription", out string val) ? val : string.Empty;
|
IssueDescription = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueDescription, out string val) ? val : string.Empty;
|
||||||
IssueCategory = opts.Substitutes.TryGetValue("IssueCategory", out val) ? val : string.Empty;
|
IssueCategory = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueCategory, out val) ? val : string.Empty;
|
||||||
IssueStatus = opts.Substitutes.TryGetValue("IssueStatus", out val) ? val : string.Empty;
|
IssueStatus = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueStatus, out val) ? val : string.Empty;
|
||||||
IssueSubject = opts.Substitutes.TryGetValue("IssueSubject", out val) ? val : string.Empty;
|
IssueSubject = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueSubject, out val) ? val : string.Empty;
|
||||||
NewIssueComment = opts.Substitutes.TryGetValue("NewIssueComment", out val) ? val : string.Empty;
|
NewIssueComment = opts.Substitutes.TryGetValue(NotificationSubstitues.NewIssueComment, out val) ? val : string.Empty;
|
||||||
UserName = opts.Substitutes.TryGetValue("IssueUser", out val) ? val : string.Empty;
|
UserName = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueUser, out val) ? val : string.Empty;
|
||||||
Alias = opts.Substitutes.TryGetValue("IssueUserAlias", out val) ? val : string.Empty;
|
Alias = opts.Substitutes.TryGetValue(NotificationSubstitues.IssueUserAlias, out val) ? val : string.Empty;
|
||||||
Type = opts.Substitutes.TryGetValue("RequestType", out val) && Enum.TryParse(val, out RequestType type)
|
Type = opts.Substitutes.TryGetValue(NotificationSubstitues.RequestType, out val) && Enum.TryParse(val, out RequestType type)
|
||||||
? HumanizeReturnType(type)
|
? HumanizeReturnType(type)
|
||||||
: string.Empty;
|
: string.Empty;
|
||||||
|
PosterImage = opts.Substitutes.TryGetValue(NotificationSubstitues.PosterPath, out val) ? $"https://image.tmdb.org/t/p/w300/{val.TrimStart('/')}" : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadCommon(BaseRequest req, CustomizationSettings s, UserNotificationPreferences pref, NotificationOptions opts)
|
private void LoadCommon(BaseRequest req, CustomizationSettings s, UserNotificationPreferences pref, NotificationOptions opts)
|
||||||
|
|
|
@ -25,6 +25,8 @@ namespace Ombi.Store.Entities.Requests
|
||||||
public string UserReportedId { get; set; }
|
public string UserReportedId { get; set; }
|
||||||
public OmbiUser UserReported { get; set; }
|
public OmbiUser UserReported { get; set; }
|
||||||
public List<IssueComments> Comments { get; set; }
|
public List<IssueComments> Comments { get; set; }
|
||||||
|
[NotMapped]
|
||||||
|
public string PosterPath { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum IssueStatus
|
public enum IssueStatus
|
||||||
|
|
3
src/Ombi/.vscode/settings.json
vendored
3
src/Ombi/.vscode/settings.json
vendored
|
@ -17,6 +17,7 @@
|
||||||
"settings",
|
"settings",
|
||||||
"user-management",
|
"user-management",
|
||||||
"newsletter",
|
"newsletter",
|
||||||
"mass-email"
|
"mass-email",
|
||||||
|
"issues"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ export interface IIssues {
|
||||||
comments: IIssueComments[];
|
comments: IIssueComments[];
|
||||||
requestId: number | undefined;
|
requestId: number | undefined;
|
||||||
userReported: IUser | undefined;
|
userReported: IUser | undefined;
|
||||||
|
posterPath: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum IssueStatus {
|
export enum IssueStatus {
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
<mat-card-title>{{issue.subject}}</mat-card-title>
|
<mat-card-title>{{issue.subject}}</mat-card-title>
|
||||||
<mat-card-subtitle>{{'Issues.UserOnDate' | translate: { user: issue.userReported?.userName, date: issue.createdDate | amLocal | amUserLocale | amDateFormat: 'LL' } }}</mat-card-subtitle>
|
<mat-card-subtitle>{{'Issues.UserOnDate' | translate: { user: issue.userReported?.userName, date: issue.createdDate | amLocal | amUserLocale | amDateFormat: 'LL' } }}</mat-card-subtitle>
|
||||||
|
<mat-card-subtitle>{{issue.issueCategory.value}}</mat-card-subtitle>
|
||||||
</mat-card-header>
|
</mat-card-header>
|
||||||
<mat-card-content>
|
<mat-card-content>
|
||||||
<p>
|
<p>
|
||||||
|
@ -10,7 +11,7 @@
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
<mat-card-actions>
|
<mat-card-actions>
|
||||||
<button mat-raised-button (click)="openChat(issue)" color="accent"><i class="far fa-comments"></i> {{'Issues.Chat' | translate }}</button>
|
<button mat-raised-button (click)="openChat(issue)" color="accent"><i class="far fa-comments"></i> {{'Issues.Chat' | translate }}</button>
|
||||||
<div *ngIf="isAdmin && settings;then content else empty">here is ignored</div>
|
<div *ngIf="isAdmin && settings;then content else empty"></div>
|
||||||
<ng-template #content>
|
<ng-template #content>
|
||||||
<button mat-raised-button color="accent"
|
<button mat-raised-button color="accent"
|
||||||
*ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress"
|
*ngIf="issue.status === IssueStatus.Pending && settings.enableInProgress"
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
@import "~styles/variables.scss";
|
@import "~styles/variables.scss";
|
||||||
|
|
||||||
::ng-deep .mat-card {
|
|
||||||
background: $ombi-background-primary-accent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top-spacing {
|
.top-spacing {
|
||||||
margin-top:2%;
|
margin-top:2%;
|
||||||
}
|
}
|
|
@ -1,13 +1,13 @@
|
||||||
import { Component, Inject, OnInit, ViewEncapsulation } from "@angular/core";
|
|
||||||
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
|
||||||
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from "@angular/router";
|
import { ActivatedRoute, ActivatedRouteSnapshot, Router } from "@angular/router";
|
||||||
import { TranslateService } from "@ngx-translate/core";
|
import { Component, Inject, OnInit, ViewEncapsulation } from "@angular/core";
|
||||||
import { AuthService } from "../../../auth/auth.service";
|
import { IIssueSettings, IIssues, IIssuesSummary, IssueStatus, RequestType } from "../../../interfaces";
|
||||||
import { IIssues, IIssueSettings, IIssuesSummary, IssueStatus, RequestType } from "../../../interfaces";
|
|
||||||
import { IssuesService, NotificationService, SettingsService } from "../../../services";
|
import { IssuesService, NotificationService, SettingsService } from "../../../services";
|
||||||
import { IssuesV2Service } from "../../../services/issuesv2.service";
|
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { IssueChatComponent } from "../issue-chat/issue-chat.component";
|
|
||||||
|
|
||||||
|
import { AuthService } from "../../../auth/auth.service";
|
||||||
|
import { IssueChatComponent } from "../issue-chat/issue-chat.component";
|
||||||
|
import { IssuesV2Service } from "../../../services/issuesv2.service";
|
||||||
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
|
|
||||||
export interface IssuesDetailsGroupData {
|
export interface IssuesDetailsGroupData {
|
||||||
issues: IIssues[];
|
issues: IIssues[];
|
||||||
|
@ -77,15 +77,15 @@ export class IssuesDetailsComponent implements OnInit {
|
||||||
const firstIssue = this.details.issues[0];
|
const firstIssue = this.details.issues[0];
|
||||||
switch(firstIssue.requestType) {
|
switch(firstIssue.requestType) {
|
||||||
case RequestType.movie:
|
case RequestType.movie:
|
||||||
this.router.navigate(['/details/movie/', firstIssue.providerId]);
|
this.router.navigate(['/details/movie/', this.providerId]);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case RequestType.album:
|
case RequestType.album:
|
||||||
this.router.navigate(['/details/artist/', firstIssue.providerId]);
|
this.router.navigate(['/details/artist/', this.providerId]);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case RequestType.tvShow:
|
case RequestType.tvShow:
|
||||||
this.router.navigate(['/details/tv/', firstIssue.providerId]);
|
this.router.navigate(['/details/tv/', this.providerId]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ export class IssueDetailsComponent implements OnInit {
|
||||||
requestId: x.requestId,
|
requestId: x.requestId,
|
||||||
providerId: x.providerId,
|
providerId: x.providerId,
|
||||||
userReported: x.userReported,
|
userReported: x.userReported,
|
||||||
|
posterPath: undefined, // Poster Path is not stored in the db, will always be undefined
|
||||||
};
|
};
|
||||||
this.setBackground(x);
|
this.setBackground(x);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
import { MovieDetailsComponent } from "./movie/movie-details.component";
|
import { IssuesService, RadarrService, RequestService, SearchService, SonarrService } from "../../services";
|
||||||
import { YoutubeTrailerComponent } from "./shared/youtube-trailer.component";
|
|
||||||
import { TvDetailsComponent } from "./tv/tv-details.component";
|
|
||||||
import { MovieInformationPanelComponent } from "./movie/panels/movie-information-panel.component";
|
|
||||||
import { TvInformationPanelComponent } from "./tv/panels/tv-information-panel/tv-information-panel.component";
|
|
||||||
import { TopBannerComponent } from "./shared/top-banner/top-banner.component";
|
|
||||||
import { SocialIconsComponent } from "./shared/social-icons/social-icons.component";
|
|
||||||
import { MediaPosterComponent } from "./shared/media-poster/media-poster.component";
|
|
||||||
import { CastCarouselComponent } from "./shared/cast-carousel/cast-carousel.component";
|
|
||||||
import { DenyDialogComponent } from "./shared/deny-dialog/deny-dialog.component";
|
|
||||||
import { TvRequestsPanelComponent } from "./tv/panels/tv-requests/tv-requests-panel.component";
|
|
||||||
import { MovieAdvancedOptionsComponent } from "./movie/panels/movie-advanced-options/movie-advanced-options.component";
|
|
||||||
import { SearchService, RequestService, RadarrService, IssuesService, SonarrService } from "../../services";
|
|
||||||
import { RequestServiceV2 } from "../../services/requestV2.service";
|
|
||||||
import { NewIssueComponent } from "./shared/new-issue/new-issue.component";
|
|
||||||
import { ArtistDetailsComponent } from "./artist/artist-details.component";
|
import { ArtistDetailsComponent } from "./artist/artist-details.component";
|
||||||
import { ArtistInformationPanel } from "./artist/panels/artist-information-panel/artist-information-panel.component";
|
import { ArtistInformationPanel } from "./artist/panels/artist-information-panel/artist-information-panel.component";
|
||||||
import { ArtistReleasePanel } from "./artist/panels/artist-release-panel/artist-release-panel.component";
|
import { ArtistReleasePanel } from "./artist/panels/artist-release-panel/artist-release-panel.component";
|
||||||
|
import { CastCarouselComponent } from "./shared/cast-carousel/cast-carousel.component";
|
||||||
|
import { DenyDialogComponent } from "./shared/deny-dialog/deny-dialog.component";
|
||||||
import { IssuesPanelComponent } from "./shared/issues-panel/issues-panel.component";
|
import { IssuesPanelComponent } from "./shared/issues-panel/issues-panel.component";
|
||||||
import { TvAdvancedOptionsComponent } from "./tv/panels/tv-advanced-options/tv-advanced-options.component";
|
import { MediaPosterComponent } from "./shared/media-poster/media-poster.component";
|
||||||
|
import { MovieAdvancedOptionsComponent } from "./movie/panels/movie-advanced-options/movie-advanced-options.component";
|
||||||
|
import { MovieDetailsComponent } from "./movie/movie-details.component";
|
||||||
|
import { MovieInformationPanelComponent } from "./movie/panels/movie-information-panel.component";
|
||||||
|
import { NewIssueComponent } from "./shared/new-issue/new-issue.component";
|
||||||
import { RequestBehalfComponent } from "./shared/request-behalf/request-behalf.component";
|
import { RequestBehalfComponent } from "./shared/request-behalf/request-behalf.component";
|
||||||
|
import { RequestServiceV2 } from "../../services/requestV2.service";
|
||||||
|
import { SocialIconsComponent } from "./shared/social-icons/social-icons.component";
|
||||||
|
import { TopBannerComponent } from "./shared/top-banner/top-banner.component";
|
||||||
|
import { TvAdvancedOptionsComponent } from "./tv/panels/tv-advanced-options/tv-advanced-options.component";
|
||||||
|
import { TvDetailsComponent } from "./tv/tv-details.component";
|
||||||
|
import { TvInformationPanelComponent } from "./tv/panels/tv-information-panel/tv-information-panel.component";
|
||||||
import { TvRequestGridComponent } from "./tv/panels/tv-request-grid/tv-request-grid.component";
|
import { TvRequestGridComponent } from "./tv/panels/tv-request-grid/tv-request-grid.component";
|
||||||
import { DetailsGroupComponent } from "../../issues/components/details-group/details-group.component";
|
import { TvRequestsPanelComponent } from "./tv/panels/tv-requests/tv-requests-panel.component";
|
||||||
|
import { YoutubeTrailerComponent } from "./shared/youtube-trailer.component";
|
||||||
|
|
||||||
export const components: any[] = [
|
export const components: any[] = [
|
||||||
MovieDetailsComponent,
|
MovieDetailsComponent,
|
||||||
|
|
|
@ -145,7 +145,7 @@ export class MovieDetailsComponent {
|
||||||
}
|
}
|
||||||
const dialogRef = this.dialog.open(NewIssueComponent, {
|
const dialogRef = this.dialog.open(NewIssueComponent, {
|
||||||
width: '500px',
|
width: '500px',
|
||||||
data: { requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, providerId: provider, title: this.movie.title }
|
data: { requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, providerId: provider, title: this.movie.title, posterPath: this.movie.posterPath }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,4 +11,5 @@ export interface IIssueDialogData {
|
||||||
requestId: number;
|
requestId: number;
|
||||||
providerId: string;
|
providerId: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
posterPath: string;
|
||||||
}
|
}
|
|
@ -1,9 +1,10 @@
|
||||||
import { Component, Inject, OnInit } from "@angular/core";
|
import { Component, Inject, OnInit } from "@angular/core";
|
||||||
import { IDenyDialogData, IIssueDialogData } from "../interfaces/interfaces";
|
import { IIssueDialogData } from "../interfaces/interfaces";
|
||||||
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
||||||
import { MessageService, IssuesService } from "../../../../services";
|
import { MessageService, IssuesService } from "../../../../services";
|
||||||
import { IIssues, IIssueCategory, IssueStatus, RequestType } from "../../../../interfaces";
|
import { IIssues, IIssueCategory, IssueStatus, RequestType } from "../../../../interfaces";
|
||||||
import { TranslateService } from "@ngx-translate/core";
|
import { TranslateService } from "@ngx-translate/core";
|
||||||
|
import { firstValueFrom } from "rxjs";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "new-issue",
|
selector: "new-issue",
|
||||||
|
@ -20,7 +21,6 @@ export class NewIssueComponent implements OnInit {
|
||||||
private issueService: IssuesService,
|
private issueService: IssuesService,
|
||||||
public messageService: MessageService,
|
public messageService: MessageService,
|
||||||
private translate: TranslateService) {
|
private translate: TranslateService) {
|
||||||
debugger;
|
|
||||||
this.issue = {
|
this.issue = {
|
||||||
subject: "",
|
subject: "",
|
||||||
description: "",
|
description: "",
|
||||||
|
@ -35,11 +35,13 @@ export class NewIssueComponent implements OnInit {
|
||||||
title: data.title,
|
title: data.title,
|
||||||
providerId: data.providerId,
|
providerId: data.providerId,
|
||||||
userReported: undefined,
|
userReported: undefined,
|
||||||
|
posterPath: data.posterPath,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public async ngOnInit(): Promise<void> {
|
public async ngOnInit(): Promise<void> {
|
||||||
this.issueCategories = await this.issueService.getCategories().toPromise();
|
const categories$ = this.issueService.getCategories();
|
||||||
|
this.issueCategories = await firstValueFrom(categories$);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async createIssue() {
|
public async createIssue() {
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-10">
|
<div class="col-12 col-md-10">
|
||||||
<div class="issuesPanel">
|
<div class="issuesPanel">
|
||||||
<issues-panel [providerId]="tv.theTvDbId" [isAdmin]="isAdmin"></issues-panel>
|
<issues-panel [providerId]="tv.id" [isAdmin]="isAdmin"></issues-panel>
|
||||||
</div>
|
</div>
|
||||||
<mat-accordion id="requests-panel">
|
<mat-accordion id="requests-panel">
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
|
|
|
@ -84,7 +84,7 @@ export class TvDetailsComponent implements OnInit {
|
||||||
public async issue() {
|
public async issue() {
|
||||||
const dialogRef = this.dialog.open(NewIssueComponent, {
|
const dialogRef = this.dialog.open(NewIssueComponent, {
|
||||||
width: '500px',
|
width: '500px',
|
||||||
data: { requestId: this.tvRequest ? this.tv.requestId : null, requestType: RequestType.tvShow, providerId: this.tv.theTvDbId, title: this.tv.title }
|
data: { requestId: this.tvRequest ? this.tv.requestId : null, requestType: RequestType.tvShow, providerId: this.tv.id, title: this.tv.title, posterPath: this.tv.images.original }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { Component, EventEmitter, Input, Output } from "@angular/core";
|
import { Component, EventEmitter, Input, Output } from "@angular/core";
|
||||||
|
|
||||||
import { IIssueCategory, IIssues, IssueStatus, RequestType } from "../interfaces";
|
import { IIssueCategory, IIssues, IssueStatus, RequestType } from "../interfaces";
|
||||||
import { IssuesService, NotificationService } from "../services";
|
import { IssuesService, NotificationService } from "../services";
|
||||||
|
|
||||||
|
@ -44,6 +43,7 @@ export class IssuesReportComponent {
|
||||||
title: "",
|
title: "",
|
||||||
providerId: "",
|
providerId: "",
|
||||||
userReported: undefined,
|
userReported: undefined,
|
||||||
|
posterPath: undefined
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ export class IssuesReportComponent {
|
||||||
issue.issueCategoryId = this.issueCategory.id;
|
issue.issueCategoryId = this.issueCategory.id;
|
||||||
issue.title = this.title;
|
issue.title = this.title;
|
||||||
issue.providerId = this.providerId;
|
issue.providerId = this.providerId;
|
||||||
|
issue.posterPath = this.posterPath;
|
||||||
if (this.movie) {
|
if (this.movie) {
|
||||||
issue.requestType = RequestType.movie;
|
issue.requestType = RequestType.movie;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -244,9 +244,9 @@ namespace Ombi.Controllers.V1
|
||||||
|
|
||||||
var isAdmin = await _userManager.IsInRoleAsync(user, OmbiRoles.Admin) || user.IsSystemUser;
|
var isAdmin = await _userManager.IsInRoleAsync(user, OmbiRoles.Admin) || user.IsSystemUser;
|
||||||
AddIssueNotificationSubstitutes(notificationModel, issue, user.UserName, user.UserAlias);
|
AddIssueNotificationSubstitutes(notificationModel, issue, user.UserName, user.UserAlias);
|
||||||
notificationModel.Substitutes.Add("NewIssueComment", comment.Comment);
|
notificationModel.Substitutes.Add(NotificationSubstitues.NewIssueComment, comment.Comment);
|
||||||
notificationModel.Substitutes.Add("IssueId", comment.IssueId.ToString());
|
notificationModel.Substitutes.Add(NotificationSubstitues.IssueId, comment.IssueId.ToString());
|
||||||
notificationModel.Substitutes.Add("AdminComment", isAdmin.ToString());
|
notificationModel.Substitutes.Add(NotificationSubstitues.AdminComment, isAdmin.ToString());
|
||||||
|
|
||||||
if (isAdmin)
|
if (isAdmin)
|
||||||
{
|
{
|
||||||
|
@ -331,14 +331,15 @@ namespace Ombi.Controllers.V1
|
||||||
|
|
||||||
private static void AddIssueNotificationSubstitutes(NotificationOptions notificationModel, Issues issue, string issueReportedUsername, string alias)
|
private static void AddIssueNotificationSubstitutes(NotificationOptions notificationModel, Issues issue, string issueReportedUsername, string alias)
|
||||||
{
|
{
|
||||||
notificationModel.Substitutes.Add("Title", issue.Title);
|
notificationModel.Substitutes.Add(NotificationSubstitues.Title, issue.Title);
|
||||||
notificationModel.Substitutes.Add("IssueDescription", issue.Description);
|
notificationModel.Substitutes.Add(NotificationSubstitues.IssueDescription, issue.Description);
|
||||||
notificationModel.Substitutes.Add("IssueCategory", issue.IssueCategory?.Value);
|
notificationModel.Substitutes.Add(NotificationSubstitues.IssueCategory, issue.IssueCategory?.Value);
|
||||||
notificationModel.Substitutes.Add("IssueStatus", issue.Status.ToString());
|
notificationModel.Substitutes.Add(NotificationSubstitues.IssueStatus, issue.Status.ToString());
|
||||||
notificationModel.Substitutes.Add("IssueSubject", issue.Subject);
|
notificationModel.Substitutes.Add(NotificationSubstitues.IssueSubject, issue.Subject);
|
||||||
notificationModel.Substitutes.Add("IssueUser", issueReportedUsername);
|
notificationModel.Substitutes.Add(NotificationSubstitues.IssueUser, issueReportedUsername);
|
||||||
notificationModel.Substitutes.Add("IssueUserAlias", alias);
|
notificationModel.Substitutes.Add(NotificationSubstitues.IssueUserAlias, alias);
|
||||||
notificationModel.Substitutes.Add("RequestType", notificationModel.RequestType.ToString());
|
notificationModel.Substitutes.Add(NotificationSubstitues.RequestType, notificationModel.RequestType.ToString());
|
||||||
|
notificationModel.Substitutes.Add(NotificationSubstitues.PosterPath, issue.PosterPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue