Made the search page all async goodness #278

This commit is contained in:
tidusjar 2016-05-27 22:04:25 +01:00
parent 05b219a351
commit 03ce361183
13 changed files with 432 additions and 183 deletions

View file

@ -78,6 +78,13 @@ namespace PlexRequests.Core
return blob != null ? ByteConverterHelper.ReturnObject<RequestedModel>(blob.Content) : null;
}
public async Task<RequestedModel> CheckRequestAsync(int providerId)
{
var blobs = await Repo.GetAllAsync();
var blob = blobs.FirstOrDefault(x => x.ProviderId == providerId);
return blob != null ? ByteConverterHelper.ReturnObject<RequestedModel>(blob.Content) : null;
}
public RequestedModel CheckRequest(string musicId)
{
var blobs = Repo.GetAll();
@ -85,6 +92,13 @@ namespace PlexRequests.Core
return blob != null ? ByteConverterHelper.ReturnObject<RequestedModel>(blob.Content) : null;
}
public async Task<RequestedModel> CheckRequestAsync(string musicId)
{
var blobs = await Repo.GetAllAsync();
var blob = blobs.FirstOrDefault(x => x.MusicId == musicId);
return blob != null ? ByteConverterHelper.ReturnObject<RequestedModel>(blob.Content) : null;
}
public void DeleteRequest(RequestedModel request)
{
var blob = Repo.Get(request.Id);