Fixed #3409 and also a error when sending whatsapp notifications

pull/3528/head
tidusjar 4 years ago
parent 2bf67ffafe
commit c0ea803611

@ -12,6 +12,10 @@ namespace Ombi.Api.Twilio
{ {
TwilioClient.Init(accountSid, authToken); TwilioClient.Init(accountSid, authToken);
if(string.IsNullOrEmpty(message.To))
{
return string.Empty;
}
var response =await MessageResource.CreateAsync( var response =await MessageResource.CreateAsync(
body: message.Message, body: message.Message,
from: new PhoneNumber($"whatsapp:{message.From}"), from: new PhoneNumber($"whatsapp:{message.From}"),

@ -29,15 +29,15 @@ namespace Ombi.Core.Rule.Rules.Request
if (obj.RequestType == RequestType.TvShow) if (obj.RequestType == RequestType.TvShow)
{ {
var tvRequest = (ChildRequests) obj; var tvRequest = (ChildRequests) obj;
var tvContent = _plexContent.GetAll().Where(x => x.Type == PlexMediaTypeEntity.Show); var tvContent = _plexContent.GetAll().Include(x => x.Episodes).Where(x => x.Type == PlexMediaTypeEntity.Show);
// We need to do a check on the TVDBId // We need to do a check on the TVDBId
var anyTvDbMatches = await tvContent.Include(x => x.Episodes).FirstOrDefaultAsync(x => x.HasTvDb && x.TvDbId == tvRequest.Id.ToString()); // the Id on the child is the tvdbid at this point var anyTvDbMatches = await tvContent.FirstOrDefaultAsync(x => x.TvDbId.Length > 0 && x.TvDbId == tvRequest.Id.ToString()); // the Id on the child is the tvdbid at this point
if (anyTvDbMatches == null) if (anyTvDbMatches == null)
{ {
// So we do not have a TVDB Id, that really sucks. // So we do not have a TVDB Id, that really sucks.
// Let's try and match on the title and year of the show // Let's try and match on the title and year of the show
var titleAndYearMatch = await tvContent.Include(x=> x.Episodes).FirstOrDefaultAsync(x => var titleAndYearMatch = await tvContent.FirstOrDefaultAsync(x =>
x.Title == tvRequest.Title x.Title == tvRequest.Title
&& x.ReleaseYear == tvRequest.ReleaseYear.Year.ToString()); && x.ReleaseYear == tvRequest.ReleaseYear.Year.ToString());
if (titleAndYearMatch != null) if (titleAndYearMatch != null)

Loading…
Cancel
Save