From c76ddbc352087144883e9ca2e11ba407732094d4 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 10 Jun 2026 11:09:11 -0400 Subject: [PATCH] chore: trace GetIntros calls and outcomes at Information level (v1.0.0.7) Logs every GetIntros call (item, path, enabled features), why an item is skipped, and pre-roll/post-roll lookup outcomes, without depending on a Debug logging.json override. --- ...fin.Plugin.CinemaTrailers4Jellyfins.csproj | 4 +-- .../Services/TrailerIntroProvider.cs | 29 +++++++++++++++++-- build.yaml | 10 +++---- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Jellyfin.Plugin.CinemaTrailers4Jellyfins.csproj b/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Jellyfin.Plugin.CinemaTrailers4Jellyfins.csproj index 9bc2552..6d5d6e4 100644 --- a/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Jellyfin.Plugin.CinemaTrailers4Jellyfins.csproj +++ b/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Jellyfin.Plugin.CinemaTrailers4Jellyfins.csproj @@ -3,8 +3,8 @@ net9.0 Jellyfin.Plugin.CinemaTrailers4Jellyfins - 1.0.0.6 - 1.0.0.6 + 1.0.0.7 + 1.0.0.7 enable false false diff --git a/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/TrailerIntroProvider.cs b/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/TrailerIntroProvider.cs index ac05cbb..1063781 100644 --- a/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/TrailerIntroProvider.cs +++ b/Jellyfin.Plugin.CinemaTrailers4Jellyfins/Services/TrailerIntroProvider.cs @@ -48,6 +48,16 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services var preRollEnabled = !string.IsNullOrEmpty(config.TrailerPreRollLibraryId); var featurePreRollEnabled = !string.IsNullOrEmpty(config.FeaturePreRollLibraryId); + _logger.LogInformation( + "|CinemaTrailers4Jellyfins| GetIntros called for {Type} '{Name}' (Path={Path}). " + + "trailersEnabled={Trailers} preRollEnabled={PreRoll} featurePreRollEnabled={FeaturePreRoll}", + item.GetType().Name, + item.Name, + item.Path, + trailersEnabled, + preRollEnabled, + featurePreRollEnabled); + if (!trailersEnabled && !preRollEnabled && !featurePreRollEnabled) return Task.FromResult(Enumerable.Empty()); @@ -65,16 +75,23 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services case Episode episode: if (!config.TrailersForEpisodes) + { + _logger.LogInformation("|CinemaTrailers4Jellyfins| Skipping: TrailersForEpisodes is disabled."); return Task.FromResult(Enumerable.Empty()); + } if (!IsFirstEpisodeOfDay(user.Id)) + { + _logger.LogInformation("|CinemaTrailers4Jellyfins| Skipping: not the first episode of the day for this user."); return Task.FromResult(Enumerable.Empty()); + } feature = episode.Series ?? (BaseItem)episode; isEpisode = true; break; default: + _logger.LogInformation("|CinemaTrailers4Jellyfins| Skipping: item type {Type} is not a Movie or Episode.", item.GetType().Name); return Task.FromResult(Enumerable.Empty()); } @@ -85,7 +102,10 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services // (covers both the fake-movie files and their trailer extras). if (!string.IsNullOrEmpty(outputFolder) && item.Path?.StartsWith(outputFolder, StringComparison.OrdinalIgnoreCase) == true) + { + _logger.LogInformation("|CinemaTrailers4Jellyfins| Skipping: item path is inside the output folder ({Folder}).", outputFolder); return Task.FromResult(Enumerable.Empty()); + } var intros = new List(); @@ -150,6 +170,11 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services intros.Add(featureRoll); } + _logger.LogInformation( + "|CinemaTrailers4Jellyfins| Returning {Count} intro(s): {Paths}", + intros.Count, + string.Join(", ", intros.Select(i => i.Path))); + return Task.FromResult>(intros); } @@ -181,7 +206,7 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services if (movies.Count == 0) { - _logger.LogDebug( + _logger.LogInformation( "|CinemaTrailers4Jellyfins| {Label} library {LibraryId} has no eligible Movie items. " + "Ensure the library has been scanned and contains at least one other Movie.", label, @@ -190,7 +215,7 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Services } var movie = movies[_rng.Next(movies.Count)]; - _logger.LogDebug( + _logger.LogInformation( "|CinemaTrailers4Jellyfins| {Label}: picked '{Title}' ({Path}).", label, movie.Name, diff --git a/build.yaml b/build.yaml index edbbbf8..1e3f91c 100644 --- a/build.yaml +++ b/build.yaml @@ -1,5 +1,5 @@ --- -version: 1.0.0.6 +version: 1.0.0.7 name: CinemaTrailers4Jellyfins guid: b581493e-1046-40ed-b6dc-cb8027624984 description: > @@ -12,10 +12,10 @@ category: General owner: 514mart targetAbi: 10.11.0.0 changelog: - - Add diagnostic logging for Trailer Pre-Roll and Feature Pre-Roll bumpers — - logs a warning if the configured library ID is invalid, and a debug message - when no eligible movie is found or which movie was picked, to help - troubleshoot why a bumper isn't playing + - Add Information-level diagnostic logging to IIntroProvider.GetIntros — logs + every call (item, path, and which features are enabled), why an item is + skipped, and the outcome of Trailer/Feature Pre-Roll lookups, to help + troubleshoot why a pre-roll bumper isn't playing dotnetProjects: - name: Jellyfin.Plugin.CinemaTrailers4Jellyfins