mirror of
https://github.com/Radarr/Radarr
synced 2026-01-23 07:54:53 +01:00
refactor(api): use async/await in MovieController.AllMovie (#107)
Convert blocking GetAwaiter().GetResult() to proper await pattern in the API controller method. Partial fix for #32 Co-authored-by: admin <admin@ardentleatherworks.com>
This commit is contained in:
parent
b413c390fd
commit
b124fd8fc0
1 changed files with 2 additions and 2 deletions
|
|
@ -114,7 +114,7 @@ public MovieController(IBroadcastSignalRMessage signalRBroadcaster,
|
|||
}
|
||||
|
||||
[HttpGet]
|
||||
public List<MovieResource> AllMovie(int? tmdbId, bool excludeLocalCovers = false, int? languageId = null)
|
||||
public async Task<List<MovieResource>> AllMovie(int? tmdbId, bool excludeLocalCovers = false, int? languageId = null)
|
||||
{
|
||||
var moviesResources = new List<MovieResource>();
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ public List<MovieResource> AllMovie(int? tmdbId, bool excludeLocalCovers = false
|
|||
var tdict = translations.ToDictionaryIgnoreDuplicates(x => x.MovieMetadataId);
|
||||
var sdict = movieStats.ToDictionary(x => x.MovieId);
|
||||
|
||||
var movies = movieTask.GetAwaiter().GetResult();
|
||||
var movies = await movieTask;
|
||||
|
||||
moviesResources = new List<MovieResource>(movies.Count);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue