mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-22 06:13:22 -07:00
feat: Add more curly variables for partially available notification
This commit is contained in:
parent
bce6f4c2f3
commit
f0aa249778
7 changed files with 23 additions and 1 deletions
|
@ -324,6 +324,8 @@ namespace Ombi.Notifications.Tests
|
|||
Assert.That("name", Is.EqualTo(sut.ApplicationName));
|
||||
Assert.That(sut.PartiallyAvailableEpisodeNumbers, Is.EqualTo("1, 2"));
|
||||
Assert.That(sut.PartiallyAvailableSeasonNumber, Is.EqualTo("1"));
|
||||
Assert.That(sut.PartiallyAvailableEpisodeCount, Is.EqualTo("2"));
|
||||
Assert.That(sut.PartiallyAvailableEpisodesList, Is.EqualTo("1x1, 1x2"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
@ -186,6 +186,14 @@ namespace Ombi.Notifications
|
|||
{
|
||||
PartiallyAvailableEpisodeNumbers = epNumber;
|
||||
}
|
||||
if (opts.Substitutes.TryGetValue("EpisodesCount", out var epCount))
|
||||
{
|
||||
PartiallyAvailableEpisodeCount = epCount;
|
||||
}
|
||||
if (opts.Substitutes.TryGetValue("SeasonEpisodes", out var sEpisodes))
|
||||
{
|
||||
PartiallyAvailableEpisodesList = sEpisodes;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,6 +303,8 @@ namespace Ombi.Notifications
|
|||
public string ProviderId { get; set; }
|
||||
public string PartiallyAvailableEpisodeNumbers { get; set; }
|
||||
public string PartiallyAvailableSeasonNumber { get; set; }
|
||||
public string PartiallyAvailableEpisodeCount { get; set; }
|
||||
public string PartiallyAvailableEpisodesList { get; set; }
|
||||
|
||||
// System Defined
|
||||
private string LongDate => DateTime.Now.ToString("D");
|
||||
|
@ -336,6 +346,8 @@ namespace Ombi.Notifications
|
|||
{ nameof(ProviderId), ProviderId },
|
||||
{ nameof(PartiallyAvailableEpisodeNumbers), PartiallyAvailableEpisodeNumbers },
|
||||
{ nameof(PartiallyAvailableSeasonNumber), PartiallyAvailableSeasonNumber },
|
||||
{ nameof(PartiallyAvailableEpisodesList), PartiallyAvailableEpisodesList },
|
||||
{ nameof(PartiallyAvailableEpisodeCount), PartiallyAvailableEpisodeCount },
|
||||
};
|
||||
}
|
||||
}
|
|
@ -212,6 +212,8 @@ namespace Ombi.Schedule.Jobs.Radarr
|
|||
};
|
||||
notification.Substitutes.Add("Season", availableEpisode.First().SeasonNumber.ToString());
|
||||
notification.Substitutes.Add("Episodes", string.Join(", ", availableEpisode.Select(x => x.EpisodeNumber)));
|
||||
notification.Substitutes.Add("EpisodesCount", $"{availableEpisode.Count}");
|
||||
notification.Substitutes.Add("SeasonEpisodes", string.Join(", ", availableEpisode.Select(x => $"{x.SeasonNumber}x{x.EpisodeNumber}" )));
|
||||
await _notification.Notify(notification);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -227,6 +227,8 @@ namespace Ombi.Schedule.Jobs.Emby
|
|||
};
|
||||
notification.Substitutes.Add("Season", availableEpisode.First().SeasonNumber.ToString());
|
||||
notification.Substitutes.Add("Episodes", string.Join(", ", availableEpisode.Select(x => x.EpisodeNumber)));
|
||||
notification.Substitutes.Add("EpisodesCount", $"{availableEpisode.Count}");
|
||||
notification.Substitutes.Add("SeasonEpisodes", string.Join(", ", availableEpisode.Select(x => $"{x.SeasonNumber}x{x.EpisodeNumber}" )));
|
||||
await _notificationService.Notify(notification);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,6 +253,8 @@ namespace Ombi.Schedule.Jobs.Jellyfin
|
|||
};
|
||||
notification.Substitutes.Add("Season", availableEpisode.First().SeasonNumber.ToString());
|
||||
notification.Substitutes.Add("Episodes", string.Join(", ", availableEpisode.Select(x => x.EpisodeNumber)));
|
||||
notification.Substitutes.Add("EpisodesCount", $"{availableEpisode.Count}");
|
||||
notification.Substitutes.Add("SeasonEpisodes", string.Join(", ", availableEpisode.Select(x => $"{x.SeasonNumber}x{x.EpisodeNumber}" )));
|
||||
await _notificationService.Notify(notification);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -174,6 +174,8 @@ namespace Ombi.Schedule.Jobs.Plex
|
|||
};
|
||||
notification.Substitutes.Add("Season", availableEpisode.First().SeasonNumber.ToString());
|
||||
notification.Substitutes.Add("Episodes", string.Join(", " ,availableEpisode.Select(x => x.EpisodeNumber)));
|
||||
notification.Substitutes.Add("EpisodesCount", $"{availableEpisode.Count}");
|
||||
notification.Substitutes.Add("SeasonEpisodes", string.Join(", ", availableEpisode.Select(x => $"{x.SeasonNumber}x{x.EpisodeNumber}" )));
|
||||
await _notificationService.Notify(notification);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ namespace Ombi.Store.Context
|
|||
notificationToAdd = new NotificationTemplates
|
||||
{
|
||||
NotificationType = notificationType,
|
||||
Message = "Your TV request for {Title} is now partially available! Season {PartiallyAvailableSeasonNumber} Episodes {PartiallyAvailableEpisodeNumbers}!",
|
||||
Message = "Your TV request for {Title} is now partially available! Episodes {PartiallyAvailableEpisodesList}!",
|
||||
Subject = "{ApplicationName}: Partially Available Request!",
|
||||
Agent = agent,
|
||||
Enabled = true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue