mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-08 14:10: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
|
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++)
|
for (var i = 1; i <= seasonCount; i++)
|
||||||
{
|
{
|
||||||
var season = new Season
|
var season = new Season
|
||||||
|
|
|
@ -26,6 +26,7 @@ namespace PlexRequests.Store
|
||||||
public string AdminNote { get; set; }
|
public string AdminNote { get; set; }
|
||||||
public int[] SeasonList { get; set; }
|
public int[] SeasonList { get; set; }
|
||||||
public int SeasonCount { get; set; }
|
public int SeasonCount { get; set; }
|
||||||
|
public string SeasonsRequested { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum RequestType
|
public enum RequestType
|
||||||
|
|
|
@ -362,7 +362,8 @@ function buildRequestContext(result, type) {
|
||||||
otherMessage: result.otherMessage,
|
otherMessage: result.otherMessage,
|
||||||
requestId: result.id,
|
requestId: result.id,
|
||||||
adminNote: result.adminNotes,
|
adminNote: result.adminNotes,
|
||||||
imdb: result.imdbId
|
imdb: result.imdbId,
|
||||||
|
seriesRequested: result.tvSeriesRequestType
|
||||||
};
|
};
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
|
|
|
@ -48,5 +48,6 @@ namespace PlexRequests.UI.Models
|
||||||
public string Issues { get; set; }
|
public string Issues { get; set; }
|
||||||
public string OtherMessage { get; set; }
|
public string OtherMessage { get; set; }
|
||||||
public string AdminNotes { 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 oldPass = Request.Form.OldPassword;
|
||||||
var newPassword = Request.Form.NewPassword;
|
var newPassword = Request.Form.NewPassword;
|
||||||
var newPasswordAgain = Request.Form.NewPasswordAgain;
|
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))
|
if (!newPassword.Equals(newPasswordAgain))
|
||||||
{
|
{
|
||||||
return Response.AsJson(new JsonResponseModel { Message = "The passwords do not match", Result = false });
|
return Response.AsJson(new JsonResponseModel { Message = "The passwords do not match", Result = false });
|
||||||
|
|
|
@ -129,7 +129,8 @@ namespace PlexRequests.UI.Modules
|
||||||
Admin = isAdmin,
|
Admin = isAdmin,
|
||||||
Issues = tv.Issues.Humanize(LetterCasing.Title),
|
Issues = tv.Issues.Humanize(LetterCasing.Title),
|
||||||
OtherMessage = tv.OtherMessage,
|
OtherMessage = tv.OtherMessage,
|
||||||
AdminNotes = tv.AdminNote
|
AdminNotes = tv.AdminNote,
|
||||||
|
TvSeriesRequestType = tv.SeasonsRequested
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
return Response.AsJson(viewModel);
|
return Response.AsJson(viewModel);
|
||||||
|
|
|
@ -261,7 +261,7 @@ namespace PlexRequests.UI.Modules
|
||||||
/// Requests the tv show.
|
/// Requests the tv show.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="showId">The show identifier.</param>
|
/// <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>
|
/// <returns></returns>
|
||||||
private Response RequestTvShow(int showId, string seasons)
|
private Response RequestTvShow(int showId, string seasons)
|
||||||
{
|
{
|
||||||
|
@ -310,9 +310,14 @@ namespace PlexRequests.UI.Modules
|
||||||
{
|
{
|
||||||
case "first":
|
case "first":
|
||||||
seasonsList.Add(1);
|
seasonsList.Add(1);
|
||||||
|
model.SeasonsRequested = "First";
|
||||||
break;
|
break;
|
||||||
case "latest":
|
case "latest":
|
||||||
seasonsList.Add(model.SeasonCount);
|
seasonsList.Add(model.SeasonCount);
|
||||||
|
model.SeasonsRequested = "Latest";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
model.SeasonsRequested = "All";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,24 +375,5 @@ namespace PlexRequests.UI.Modules
|
||||||
var result = Checker.IsAvailable(title, year);
|
var result = Checker.IsAvailable(title, year);
|
||||||
return result;
|
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
|
#endregion
|
||||||
using System;
|
using System;
|
||||||
using System.Data;
|
|
||||||
|
|
||||||
using Microsoft.Owin.Hosting;
|
using Microsoft.Owin.Hosting;
|
||||||
|
|
||||||
using Mono.Data.Sqlite;
|
using Mono.Data.Sqlite;
|
||||||
|
@ -34,9 +32,6 @@ using Mono.Unix;
|
||||||
using Mono.Unix.Native;
|
using Mono.Unix.Native;
|
||||||
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using NLog.Config;
|
|
||||||
using NLog.Targets;
|
|
||||||
|
|
||||||
using PlexRequests.Core;
|
using PlexRequests.Core;
|
||||||
using PlexRequests.Core.SettingModels;
|
using PlexRequests.Core.SettingModels;
|
||||||
using PlexRequests.Helpers;
|
using PlexRequests.Helpers;
|
||||||
|
|
|
@ -119,6 +119,9 @@
|
||||||
<i id="availableIcon{{requestId}}" class="fa fa-check"></i>
|
<i id="availableIcon{{requestId}}" class="fa fa-check"></i>
|
||||||
{{/if_eq}}
|
{{/if_eq}}
|
||||||
</div>
|
</div>
|
||||||
|
{{#if_eq type "tv"}}
|
||||||
|
<div>Series Requested: {{seriesRequested}}</div>
|
||||||
|
{{/if_eq}}
|
||||||
<div>Requested By: {{requestedBy}}</div>
|
<div>Requested By: {{requestedBy}}</div>
|
||||||
<div>Requested Date: {{requestedDate}}</div>
|
<div>Requested Date: {{requestedDate}}</div>
|
||||||
<div id="issueArea{{requestId}}">
|
<div id="issueArea{{requestId}}">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue