Fixed the login issue and pass Radarr the year #990

pull/993/head
Jamie.Rees 8 years ago
parent 3d2209d163
commit a1fb4018b5

@ -7,7 +7,7 @@ namespace Ombi.Api.Interfaces
{
public interface IRadarrApi
{
RadarrAddMovie AddMovie(int tmdbId, string title, int qualityId, string rootPath, string apiKey, Uri baseUrl, bool searchNow = false);
RadarrAddMovie AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath, string apiKey, Uri baseUrl, bool searchNow = false);
List<RadarrMovieResponse> GetMovies(string apiKey, Uri baseUrl);
List<SonarrProfile> GetProfiles(string apiKey, Uri baseUrl);
SystemStatus SystemStatus(string apiKey, Uri baseUrl);

@ -50,6 +50,7 @@ namespace Ombi.Api.Models.Radarr
public string imdbId { get; set; }
public string titleSlug { get; set; }
public int id { get; set; }
public int year { get; set; }
}
}

@ -63,7 +63,7 @@ namespace Ombi.Api
return obj;
}
public RadarrAddMovie AddMovie(int tmdbId, string title, int qualityId, string rootPath, string apiKey, Uri baseUrl, bool searchNow = false)
public RadarrAddMovie AddMovie(int tmdbId, string title, int year, int qualityId, string rootPath, string apiKey, Uri baseUrl, bool searchNow = false)
{
var request = new RestRequest
{
@ -78,7 +78,8 @@ namespace Ombi.Api
qualityProfileId = qualityId,
rootFolderPath = rootPath,
titleSlug = title,
monitored = true
monitored = true,
year = year
};
if (searchNow)

@ -106,7 +106,7 @@ namespace Ombi.Core
{
var qualityProfile = 0;
int.TryParse(settings.QualityProfile, out qualityProfile);
var result = RadarrApi.AddMovie(model.ProviderId, model.Title, qualityProfile, settings.RootPath, settings.ApiKey, settings.FullUri, true);
var result = RadarrApi.AddMovie(model.ProviderId, model.Title, model.ReleaseDate.Year, qualityProfile, settings.RootPath, settings.ApiKey, settings.FullUri, true);
if (!string.IsNullOrEmpty(result.Error?.message))
{

@ -31,6 +31,7 @@ using System.Linq;
using System.Threading;
using Nancy;
using Nancy.Security;
using NLog;
using Ombi.Core;
using Ombi.Core.SettingModels;
using Ombi.Helpers;
@ -100,6 +101,7 @@ namespace Ombi.UI.Modules
}
private static Logger Log = LogManager.GetCurrentClassLogger();
private string _username;
/// <summary>
/// Returns the Username or UserAlias
@ -112,16 +114,17 @@ namespace Ombi.UI.Modules
{
try
{
var username = Security.GetUsername(User.UserName, Session);
var username = Security.GetUsername(User?.UserName, Session);
if (string.IsNullOrEmpty(username))
{
return "Unknown User";
return string.Empty;
}
_username = username;
}
catch (Exception)
catch (Exception e)
{
return "Unknown User Error";
Log.Info(e);
return string.Empty;
}
}
return _username;

Loading…
Cancel
Save