Fix notifications when poster is not found (#89)

This commit is contained in:
Flaminel
2025-03-11 23:34:44 +02:00
committed by GitHub
parent 324c3ace8f
commit a68e13af35
@@ -128,9 +128,9 @@ public class NotificationPublisher : INotificationPublisher
{ {
Uri? image = instanceType switch Uri? image = instanceType switch
{ {
InstanceType.Sonarr => record.Series!.Images.FirstOrDefault(x => x.CoverType == "poster")?.RemoteUrl, InstanceType.Sonarr => record.Series?.Images?.FirstOrDefault(x => x.CoverType == "poster")?.RemoteUrl,
InstanceType.Radarr => record.Movie!.Images.FirstOrDefault(x => x.CoverType == "poster")?.RemoteUrl, InstanceType.Radarr => record.Movie?.Images?.FirstOrDefault(x => x.CoverType == "poster")?.RemoteUrl,
InstanceType.Lidarr => record.Album!.Images.FirstOrDefault(x => x.CoverType == "cover")?.Url, InstanceType.Lidarr => record.Album?.Images?.FirstOrDefault(x => x.CoverType == "cover")?.Url,
_ => throw new ArgumentOutOfRangeException(nameof(instanceType)) _ => throw new ArgumentOutOfRangeException(nameof(instanceType))
}; };