From ba15853ac17f92819652b814c72eb9c0921f05fd Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 30 Dec 2018 21:19:52 +0000 Subject: [PATCH] Added {AvailableDate} as a Notification Variable, this is the date the request was marked as available. See here: https://github.com/tidusjar/Ombi/wiki/Notification-Template-Variables --- src/Ombi.Notifications/NotificationMessageCurlys.cs | 5 +++++ src/Ombi/ClientApp/app/search/moviesearch.component.ts | 2 +- src/Ombi/ClientApp/app/services/search.service.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Ombi.Notifications/NotificationMessageCurlys.cs b/src/Ombi.Notifications/NotificationMessageCurlys.cs index 42c414544..c1049e703 100644 --- a/src/Ombi.Notifications/NotificationMessageCurlys.cs +++ b/src/Ombi.Notifications/NotificationMessageCurlys.cs @@ -50,6 +50,7 @@ namespace Ombi.Notifications Overview = req?.Overview; Year = req?.ReleaseDate.Year.ToString(); DenyReason = req?.DeniedReason; + AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty; if (req?.RequestType == RequestType.Movie) { PosterImage = string.Format((req?.PosterPath ?? string.Empty).StartsWith("/", StringComparison.InvariantCultureIgnoreCase) @@ -85,6 +86,7 @@ namespace Ombi.Notifications UserName = req?.RequestedUser?.UserName; } + AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty; DenyReason = req?.DeniedReason; Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; if (pref != null) @@ -133,6 +135,7 @@ namespace Ombi.Notifications // Can be set if it's an issue UserName = req?.RequestedUser?.UserName; } + AvailableDate = req?.MarkedAsAvailable?.ToString("D") ?? string.Empty; Alias = (req?.RequestedUser?.Alias.HasValue() ?? false) ? req?.RequestedUser?.Alias : req?.RequestedUser?.UserName; if (pref != null) { @@ -238,6 +241,7 @@ namespace Ombi.Notifications public string NewIssueComment { get; set; } public string UserPreference { get; set; } public string DenyReason { get; set; } + public string AvailableDate { get; set; } // System Defined private string LongDate => DateTime.Now.ToString("D"); @@ -273,6 +277,7 @@ namespace Ombi.Notifications {nameof(Alias),Alias}, {nameof(UserPreference),UserPreference}, {nameof(DenyReason),DenyReason}, + {nameof(AvailableDate),AvailableDate}, }; } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/search/moviesearch.component.ts b/src/Ombi/ClientApp/app/search/moviesearch.component.ts index 9a4ec88fe..91464229c 100644 --- a/src/Ombi/ClientApp/app/search/moviesearch.component.ts +++ b/src/Ombi/ClientApp/app/search/moviesearch.component.ts @@ -6,7 +6,7 @@ import { Subject } from "rxjs"; import { debounceTime, distinctUntilChanged } from "rxjs/operators"; import { AuthService } from "../auth/auth.service"; -import { IIssueCategory, IRequestEngineResult, ISearchMovieResult, ILanguageRefine } from "../interfaces"; +import { IIssueCategory, ILanguageRefine, IRequestEngineResult, ISearchMovieResult } from "../interfaces"; import { NotificationService, RequestService, SearchService } from "../services"; import * as languageData from "../../other/iso-lang.json"; diff --git a/src/Ombi/ClientApp/app/services/search.service.ts b/src/Ombi/ClientApp/app/services/search.service.ts index 163b0a913..327bd2a5b 100644 --- a/src/Ombi/ClientApp/app/services/search.service.ts +++ b/src/Ombi/ClientApp/app/services/search.service.ts @@ -22,7 +22,7 @@ export class SearchService extends ServiceHelpers { } public searchMovieWithRefined(searchTerm: string, year: number | undefined, langCode: string): Observable { - return this.http.post(`${this.url}/Movie/`, { searchTerm: searchTerm, year: year, languageCode: langCode }); + return this.http.post(`${this.url}/Movie/`, { searchTerm, year, languageCode: langCode }); } public similarMovies(theMovieDbId: number): Observable {