Reworked the custom notifications... again. Need to figure out how to find the view to the model

This commit is contained in:
tidusjar 2016-07-08 17:29:14 +01:00
parent f0ce5556c3
commit a19e81d1f8
6 changed files with 112 additions and 35 deletions

View file

@ -38,10 +38,11 @@ namespace PlexRequests.Core
private const char EndChar = (char)125;
public NotificationMessageContent ParseMessage<T>(T notification, NotificationType type, NotificationMessageCurlys c) where T : NotificationSettings
{
var content = notification.Message.FirstOrDefault(x => x.Key == type).Value;
//if (string.IsNullOrEmpty(notificationToParse))
// return string.Empty;
var content = notification.Message.FirstOrDefault(x => x.NotificationType == type);
if (content == null)
{
return new NotificationMessageContent();
}
return Resolve(content.Body, content.Subject, c.Curlys);
}