diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs index 3ad33f0fec..3dcdaf2efc 100644 --- a/Emby.Dlna/Didl/DidlBuilder.cs +++ b/Emby.Dlna/Didl/DidlBuilder.cs @@ -214,16 +214,17 @@ namespace Emby.Dlna.Didl AddVideoResource(writer, video, deviceId, filter, contentFeature, streamInfo); } - foreach (var subtitle in streamInfo.GetSubtitleProfiles(false, _serverAddress, _accessToken)) + var subtitleProfiles = streamInfo.GetSubtitleProfiles(false, _serverAddress, _accessToken) + .Where(subtitle => subtitle.DeliveryMethod == SubtitleDeliveryMethod.External) + .ToList(); + + foreach (var subtitle in subtitleProfiles) { - if (subtitle.DeliveryMethod == SubtitleDeliveryMethod.External) - { - var subtitleAdded = AddSubtitleElement(writer, subtitle); + var subtitleAdded = AddSubtitleElement(writer, subtitle); - if (subtitleAdded && _profile.EnableSingleSubtitleLimit) - { - break; - } + if (subtitleAdded && _profile.EnableSingleSubtitleLimit) + { + break; } } } diff --git a/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs b/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs index 767ba55049..aae41da198 100644 --- a/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs +++ b/Emby.Server.Implementations/Notifications/SqliteNotificationsRepository.cs @@ -115,18 +115,18 @@ namespace Emby.Server.Implementations.Notifications statement.TryBind("@IsRead", false); statement.TryBind("@UserId", userId.ToGuidParamValue()); + var levels = new List(); + foreach (var row in statement.ExecuteQuery()) { - var levels = new List(); - levels.Add(GetLevel(row, 0)); + } - result.UnreadCount = levels.Count; + result.UnreadCount = levels.Count; - if (levels.Count > 0) - { - result.MaxUnreadNotificationLevel = levels.Max(); - } + if (levels.Count > 0) + { + result.MaxUnreadNotificationLevel = levels.Max(); } } diff --git a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs index 05ca7c7d9a..4992675da2 100644 --- a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs @@ -232,11 +232,15 @@ namespace MediaBrowser.Providers.TV { continue; } + var now = DateTime.UtcNow; var targetSeries = DetermineAppropriateSeries(series, tuple.Item1); var seasonOffset = TvdbSeriesProvider.GetSeriesOffset(targetSeries.ProviderIds) ?? ((targetSeries.AnimeSeriesIndex ?? 1) - 1); + var unairedThresholdDays = 1; + now = now.AddDays(0 - unairedThresholdDays); + if (airDate.Value < now) { if (addMissingEpisodes)