mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-10 23:42:36 -07:00
small changes
This commit is contained in:
parent
9c61f909de
commit
07c00d232c
3 changed files with 9 additions and 14 deletions
|
@ -139,7 +139,7 @@ namespace PlexRequests.Core
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error("Failed to cache Sonarr quality profiles!", ex);
|
Log.Error(ex, "Failed to cache Sonarr quality profiles!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ namespace PlexRequests.Core
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Log.Error("Failed to cache CouchPotato quality profiles!", ex);
|
Log.Error(ex, "Failed to cache CouchPotato quality profiles!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -96,8 +96,8 @@ namespace PlexRequests.Services.Jobs
|
||||||
|
|
||||||
if (libraries == null)
|
if (libraries == null)
|
||||||
{
|
{
|
||||||
libraries = new List<PlexSearch>() { PlexApi.SearchContent(authSettings.PlexAuthToken, r.Title, plexSettings.FullUri) };
|
libraries = new List<PlexSearch> { PlexApi.SearchContent(authSettings.PlexAuthToken, r.Title, plexSettings.FullUri) };
|
||||||
if (libraries == null)
|
if (libraries.Count == 0)
|
||||||
{
|
{
|
||||||
Log.Trace("Could not find any matching result for this title.");
|
Log.Trace("Could not find any matching result for this title.");
|
||||||
continue;
|
continue;
|
||||||
|
@ -105,7 +105,6 @@ namespace PlexRequests.Services.Jobs
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Trace("Search results from Plex for the following request: {0}", r.Title);
|
Log.Trace("Search results from Plex for the following request: {0}", r.Title);
|
||||||
//Log.Trace(results.DumpJson());
|
|
||||||
|
|
||||||
var releaseDate = r.ReleaseDate == DateTime.MinValue ? string.Empty : r.ReleaseDate.ToString("yyyy");
|
var releaseDate = r.ReleaseDate == DateTime.MinValue ? string.Empty : r.ReleaseDate.ToString("yyyy");
|
||||||
|
|
||||||
|
@ -136,8 +135,7 @@ namespace PlexRequests.Services.Jobs
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.Trace("Updating the requests now");
|
Log.Trace("Updating the requests now");
|
||||||
Log.Trace("Requests that will be updates:");
|
Log.Trace("Requests that will be updated count {0}", modifiedModel.Count);
|
||||||
Log.Trace(modifiedModel.SelectMany(x => x.Title).DumpJson());
|
|
||||||
|
|
||||||
if (modifiedModel.Any())
|
if (modifiedModel.Any())
|
||||||
{
|
{
|
||||||
|
@ -257,9 +255,7 @@ namespace PlexRequests.Services.Jobs
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
results = Cache.GetOrSet(CacheKeys.PlexLibaries, () => {
|
results = Cache.GetOrSet(CacheKeys.PlexLibaries, () => GetLibraries(authSettings, plexSettings), 10);
|
||||||
return GetLibraries(authSettings, plexSettings);
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,6 @@ namespace PlexRequests.UI.Modules
|
||||||
private Response ProcessMovies(MovieSearchType searchType, string searchTerm)
|
private Response ProcessMovies(MovieSearchType searchType, string searchTerm)
|
||||||
{
|
{
|
||||||
List<Task> taskList = new List<Task>();
|
List<Task> taskList = new List<Task>();
|
||||||
var cpSettings = CpService.GetSettings();
|
|
||||||
|
|
||||||
List<MovieResult> apiMovies = new List<MovieResult>();
|
List<MovieResult> apiMovies = new List<MovieResult>();
|
||||||
taskList.Add(Task.Factory.StartNew<List<MovieResult>>(() =>
|
taskList.Add(Task.Factory.StartNew<List<MovieResult>>(() =>
|
||||||
|
@ -264,9 +263,9 @@ namespace PlexRequests.UI.Modules
|
||||||
{
|
{
|
||||||
Log.Trace("Searching for TV Show {0}", searchTerm);
|
Log.Trace("Searching for TV Show {0}", searchTerm);
|
||||||
|
|
||||||
List<Task> taskList = new List<Task>();
|
var taskList = new List<Task>();
|
||||||
|
|
||||||
List<TvMazeSearch> apiTv = new List<TvMazeSearch>();
|
var apiTv = new List<TvMazeSearch>();
|
||||||
taskList.Add(Task.Factory.StartNew(() =>
|
taskList.Add(Task.Factory.StartNew(() =>
|
||||||
{
|
{
|
||||||
return new TvMazeApi().Search(searchTerm);
|
return new TvMazeApi().Search(searchTerm);
|
||||||
|
@ -276,7 +275,7 @@ namespace PlexRequests.UI.Modules
|
||||||
apiTv = t.Result;
|
apiTv = t.Result;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Dictionary<int, RequestedModel> dbTv = new Dictionary<int, RequestedModel>();
|
var dbTv = new Dictionary<int, RequestedModel>();
|
||||||
taskList.Add(Task.Factory.StartNew(() =>
|
taskList.Add(Task.Factory.StartNew(() =>
|
||||||
{
|
{
|
||||||
return RequestService.GetAll().Where(x => x.Type == RequestType.TvShow);
|
return RequestService.GetAll().Where(x => x.Type == RequestType.TvShow);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue