mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
#27 added TV Search to the notification
This commit is contained in:
parent
d07f544099
commit
4c59e9d19c
2 changed files with 15 additions and 3 deletions
|
@ -78,9 +78,12 @@ $(function () {
|
||||||
if (seasons === "1") {
|
if (seasons === "1") {
|
||||||
// Send over the first season
|
// Send over the first season
|
||||||
data = data + "&seasons=first";
|
data = data + "&seasons=first";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var $notify = $('#notifyUser').is(':checked');
|
||||||
|
|
||||||
|
data = data + "¬ify=" + $notify;
|
||||||
|
|
||||||
var type = $form.prop('method');
|
var type = $form.prop('method');
|
||||||
var url = $form.prop('action');
|
var url = $form.prop('action');
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ namespace PlexRequests.UI.Modules
|
||||||
Get["movie/playing"] = parameters => CurrentlyPlayingMovies();
|
Get["movie/playing"] = parameters => CurrentlyPlayingMovies();
|
||||||
|
|
||||||
Post["request/movie"] = parameters => RequestMovie((int)Request.Form.movieId, (bool)Request.Form.notify);
|
Post["request/movie"] = parameters => RequestMovie((int)Request.Form.movieId, (bool)Request.Form.notify);
|
||||||
Post["request/tv"] = parameters => RequestTvShow((int)Request.Form.tvId, (string)Request.Form.seasons);
|
Post["request/tv"] = parameters => RequestTvShow((int)Request.Form.tvId, (string)Request.Form.seasons, (bool)Request.Form.notify);
|
||||||
Post["request/album"] = parameters => RequestAlbum((string)Request.Form.albumId);
|
Post["request/album"] = parameters => RequestAlbum((string)Request.Form.albumId);
|
||||||
}
|
}
|
||||||
private IPlexApi PlexApi { get; }
|
private IPlexApi PlexApi { get; }
|
||||||
|
@ -568,8 +568,9 @@ namespace PlexRequests.UI.Modules
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="showId">The show identifier.</param>
|
/// <param name="showId">The show identifier.</param>
|
||||||
/// <param name="seasons">The seasons.</param>
|
/// <param name="seasons">The seasons.</param>
|
||||||
|
/// <param name="notify">if set to <c>true</c> [notify].</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private Response RequestTvShow(int showId, string seasons)
|
private Response RequestTvShow(int showId, string seasons, bool notify)
|
||||||
{
|
{
|
||||||
var tvApi = new TvMazeApi();
|
var tvApi = new TvMazeApi();
|
||||||
|
|
||||||
|
@ -589,6 +590,10 @@ namespace PlexRequests.UI.Modules
|
||||||
// check if the current user is already marked as a requester for this show, if not, add them
|
// check if the current user is already marked as a requester for this show, if not, add them
|
||||||
if (!existingRequest.UserHasRequested(Username))
|
if (!existingRequest.UserHasRequested(Username))
|
||||||
{
|
{
|
||||||
|
if (notify)
|
||||||
|
{
|
||||||
|
existingRequest.AddUserToNotification(Username);
|
||||||
|
}
|
||||||
existingRequest.RequestedUsers.Add(Username);
|
existingRequest.RequestedUsers.Add(Username);
|
||||||
RequestService.UpdateRequest(existingRequest);
|
RequestService.UpdateRequest(existingRequest);
|
||||||
}
|
}
|
||||||
|
@ -626,6 +631,10 @@ namespace PlexRequests.UI.Modules
|
||||||
ImdbId = showInfo.externals?.imdb ?? string.Empty,
|
ImdbId = showInfo.externals?.imdb ?? string.Empty,
|
||||||
SeasonCount = showInfo.seasonCount
|
SeasonCount = showInfo.seasonCount
|
||||||
};
|
};
|
||||||
|
if (notify)
|
||||||
|
{
|
||||||
|
model.AddUserToNotification(Username);
|
||||||
|
}
|
||||||
var seasonsList = new List<int>();
|
var seasonsList = new List<int>();
|
||||||
switch (seasons)
|
switch (seasons)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue