Increased the delay for the Episode information api calls. #1163

Fixed the issue with notifications being slightly borked #1263

Fixed the issue for Radarr, the api changed again #1263
pull/1267/head
tidusjar 7 years ago
parent b9c0c20af6
commit 2d0297231d

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

@ -29,6 +29,9 @@ using System.Collections.Generic;
namespace Ombi.Api.Models.Radarr
{
/// <summary>
/// This is not used now... Keeping it here incase Radarr changes their mind again.
/// </summary>
public class RadarrMovieContainer
{
public int page { get; set; }

@ -152,7 +152,7 @@ namespace Ombi.Api
}
public RadarrMovieContainer GetMovies(string apiKey, Uri baseUrl)
public List<RadarrMovieResponse> GetMovies(string apiKey, Uri baseUrl)
{
var request = new RestRequest { Resource = "/api/movie", Method = Method.GET };
request.AddHeader("X-Api-Key", apiKey);
@ -165,7 +165,7 @@ namespace Ombi.Api
var obj = policy.Execute(() => Api.Execute(request, baseUrl));
return JsonConvert.DeserializeObject<RadarrMovieContainer>(obj.Content);
return JsonConvert.DeserializeObject<List<RadarrMovieResponse>>(obj.Content);
}
}
}

@ -67,7 +67,7 @@ namespace Ombi.Services.Jobs
if (movies != null)
{
var movieIds = new List<int>();
foreach (var m in movies.records)
foreach (var m in movies)
{
if (m.tmdbId > 0)
{

@ -154,7 +154,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
Ombi.Api.Models.Emby.EmbyMediaType.Episode,
embySettings.ApiKey, embySettings.AdministratorId, embySettings.FullUri);
episodeList.Add(epInfo.EpisodeInformation);
Thread.Sleep(200); // Let's not try and overload the server
Thread.Sleep(600); // Let's not try and overload the server
}
item.EpisodeInformation = episodeList;
}
@ -162,7 +162,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
{
Log.Error(
"Failed getting episode information, we may have overloaded Emby's api... Waiting and we will skip this one and go to the next");
Thread.Sleep(500);
Thread.Sleep(1000);
}
}

@ -76,7 +76,7 @@ namespace Ombi.Services.Notification
{
Message = html,
Subject = $"Ombi: New {model.RequestType.GetString()?.ToLower()} request for {model.Title}!",
To = model.UserEmail,
To = settings.RecipientEmail,
};
message.Other.Add("PlainTextBody", $"Hello! The user '{model.User}' has requested the {model.RequestType.GetString()?.ToLower()} '{model.Title}'! Please log in to approve this request. Request Date: {model.DateTime.ToString("f")}");
@ -96,7 +96,7 @@ namespace Ombi.Services.Notification
{
Message = html,
Subject = $"Ombi: New issue for {model.Title}!",
To = model.UserEmail,
To = settings.RecipientEmail,
};
message.Other.Add("PlainTextBody", $"Hello! The user '{model.User}' has reported a new issue {model.Body} for the title {model.Title}!");
@ -118,7 +118,7 @@ namespace Ombi.Services.Notification
{
Message = html,
Subject = $"Ombi: A request could not be added",
To = model.UserEmail,
To = settings.RecipientEmail,
};
message.Other.Add("PlainTextBody", $"Hello! The user '{model.User}' has requested {model.Title} but it could not be added. This has been added into the requests queue and will keep retrying");
@ -241,7 +241,7 @@ namespace Ombi.Services.Notification
{
Message = html,
Subject = $"Ombi: Test",
To = model.UserEmail,
To = settings.RecipientEmail,
};
message.Other.Add("PlainTextBody", "This is just a test! Success!");

Loading…
Cancel
Save