mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 06:00:50 -07:00
parent
47c0c0daf0
commit
25a8563ee8
9 changed files with 32 additions and 56 deletions
|
@ -63,37 +63,18 @@ namespace PlexRequests.Api
|
|||
Method = Method.POST
|
||||
};
|
||||
|
||||
var options = new SonarrAddSeries();
|
||||
var options = new SonarrAddSeries
|
||||
{
|
||||
seasonFolder = seasonFolders,
|
||||
title = title,
|
||||
qualityProfileId = qualityId,
|
||||
tvdbId = tvdbId,
|
||||
titleSlug = title,
|
||||
seasons = new List<Season>(),
|
||||
rootFolderPath = rootPath
|
||||
};
|
||||
|
||||
|
||||
//I'm fairly certain we won't need this logic anymore since we're manually adding the seasons
|
||||
//if (seasons.Length == 0)
|
||||
//{
|
||||
// options.addOptions = new AddOptions
|
||||
// {
|
||||
// ignoreEpisodesWithFiles = true,
|
||||
// ignoreEpisodesWithoutFiles = true,
|
||||
// searchForMissingEpisodes = false
|
||||
// };
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// options.addOptions = new AddOptions
|
||||
// {
|
||||
// ignoreEpisodesWithFiles = false,
|
||||
// ignoreEpisodesWithoutFiles = false,
|
||||
// searchForMissingEpisodes = true
|
||||
// };
|
||||
//}
|
||||
|
||||
options.seasonFolder = seasonFolders;
|
||||
options.title = title;
|
||||
options.qualityProfileId = qualityId;
|
||||
options.tvdbId = tvdbId;
|
||||
options.titleSlug = title;
|
||||
options.seasons = new List<Season>();
|
||||
options.rootFolderPath = rootPath;
|
||||
|
||||
for (var i = 1; i <= seasonCount; i++)
|
||||
{
|
||||
var season = new Season
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace PlexRequests.Store
|
|||
public string AdminNote { get; set; }
|
||||
public int[] SeasonList { get; set; }
|
||||
public int SeasonCount { get; set; }
|
||||
public string SeasonsRequested { get; set; }
|
||||
}
|
||||
|
||||
public enum RequestType
|
||||
|
|
|
@ -362,7 +362,8 @@ function buildRequestContext(result, type) {
|
|||
otherMessage: result.otherMessage,
|
||||
requestId: result.id,
|
||||
adminNote: result.adminNotes,
|
||||
imdb: result.imdbId
|
||||
imdb: result.imdbId,
|
||||
seriesRequested: result.tvSeriesRequestType
|
||||
};
|
||||
|
||||
return context;
|
||||
|
|
|
@ -48,5 +48,6 @@ namespace PlexRequests.UI.Models
|
|||
public string Issues { get; set; }
|
||||
public string OtherMessage { get; set; }
|
||||
public string AdminNotes { get; set; }
|
||||
public string TvSeriesRequestType { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,13 @@ namespace PlexRequests.UI.Modules
|
|||
var oldPass = Request.Form.OldPassword;
|
||||
var newPassword = Request.Form.NewPassword;
|
||||
var newPasswordAgain = Request.Form.NewPasswordAgain;
|
||||
|
||||
if (string.IsNullOrEmpty(oldPass) || string.IsNullOrEmpty(newPassword) ||
|
||||
string.IsNullOrEmpty(newPasswordAgain))
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel { Message = "Please fill in all fields", Result = false });
|
||||
}
|
||||
|
||||
if (!newPassword.Equals(newPasswordAgain))
|
||||
{
|
||||
return Response.AsJson(new JsonResponseModel { Message = "The passwords do not match", Result = false });
|
||||
|
|
|
@ -129,7 +129,8 @@ namespace PlexRequests.UI.Modules
|
|||
Admin = isAdmin,
|
||||
Issues = tv.Issues.Humanize(LetterCasing.Title),
|
||||
OtherMessage = tv.OtherMessage,
|
||||
AdminNotes = tv.AdminNote
|
||||
AdminNotes = tv.AdminNote,
|
||||
TvSeriesRequestType = tv.SeasonsRequested
|
||||
}).ToList();
|
||||
|
||||
return Response.AsJson(viewModel);
|
||||
|
|
|
@ -261,7 +261,7 @@ namespace PlexRequests.UI.Modules
|
|||
/// Requests the tv show.
|
||||
/// </summary>
|
||||
/// <param name="showId">The show identifier.</param>
|
||||
/// <param name="latest">if set to <c>true</c> [latest].</param>
|
||||
/// <param name="seasons">The seasons.</param>
|
||||
/// <returns></returns>
|
||||
private Response RequestTvShow(int showId, string seasons)
|
||||
{
|
||||
|
@ -310,9 +310,14 @@ namespace PlexRequests.UI.Modules
|
|||
{
|
||||
case "first":
|
||||
seasonsList.Add(1);
|
||||
model.SeasonsRequested = "First";
|
||||
break;
|
||||
case "latest":
|
||||
seasonsList.Add(model.SeasonCount);
|
||||
model.SeasonsRequested = "Latest";
|
||||
break;
|
||||
default:
|
||||
model.SeasonsRequested = "All";
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -370,24 +375,5 @@ namespace PlexRequests.UI.Modules
|
|||
var result = Checker.IsAvailable(title, year);
|
||||
return result;
|
||||
}
|
||||
|
||||
//private Response SendToSickRage(SickRageSettings sickRageSettings, RequestedModel model)
|
||||
//{
|
||||
// var result = SickrageApi.AddSeries(model.ProviderId, model.SeasonCount, model.SeasonList, sickRageSettings.QualityProfile,
|
||||
// sickRageSettings.ApiKey, sickRageSettings.FullUri);
|
||||
|
||||
// Log.Trace("SickRage Result: ");
|
||||
// Log.Trace(result.DumpJson());
|
||||
|
||||
// if (result?.result == "success")
|
||||
// {
|
||||
// model.Approved = true;
|
||||
// Log.Debug("Adding tv to database requests (No approval required & SickRage)");
|
||||
// RequestService.AddRequest(model);
|
||||
|
||||
// return Response.AsJson(new JsonResponseModel { Result = true });
|
||||
// }
|
||||
// return Response.AsJson(new JsonResponseModel { Result = false, Message = "Something went wrong adding the movie to SickRage! Please check your settings." });
|
||||
//}
|
||||
}
|
||||
}
|
|
@ -25,8 +25,6 @@
|
|||
// ************************************************************************/
|
||||
#endregion
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
using Microsoft.Owin.Hosting;
|
||||
|
||||
using Mono.Data.Sqlite;
|
||||
|
@ -34,9 +32,6 @@ using Mono.Unix;
|
|||
using Mono.Unix.Native;
|
||||
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using NLog.Targets;
|
||||
|
||||
using PlexRequests.Core;
|
||||
using PlexRequests.Core.SettingModels;
|
||||
using PlexRequests.Helpers;
|
||||
|
|
|
@ -119,6 +119,9 @@
|
|||
<i id="availableIcon{{requestId}}" class="fa fa-check"></i>
|
||||
{{/if_eq}}
|
||||
</div>
|
||||
{{#if_eq type "tv"}}
|
||||
<div>Series Requested: {{seriesRequested}}</div>
|
||||
{{/if_eq}}
|
||||
<div>Requested By: {{requestedBy}}</div>
|
||||
<div>Requested Date: {{requestedDate}}</div>
|
||||
<div id="issueArea{{requestId}}">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue