chore: trace GetIntros calls and outcomes at Information level (v1.0.0.7)
All checks were successful
Publish Release / release (push) Successful in 10s

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.
This commit is contained in:
Martin
2026-06-10 11:09:11 -04:00
parent e9d9543941
commit c76ddbc352
3 changed files with 34 additions and 9 deletions

View File

@@ -3,8 +3,8 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Jellyfin.Plugin.CinemaTrailers4Jellyfins</RootNamespace>
<AssemblyVersion>1.0.0.6</AssemblyVersion>
<FileVersion>1.0.0.6</FileVersion>
<AssemblyVersion>1.0.0.7</AssemblyVersion>
<FileVersion>1.0.0.7</FileVersion>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>

View File

@@ -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<IntroInfo>());
@@ -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<IntroInfo>());
}
if (!IsFirstEpisodeOfDay(user.Id))
{
_logger.LogInformation("|CinemaTrailers4Jellyfins| Skipping: not the first episode of the day for this user.");
return Task.FromResult(Enumerable.Empty<IntroInfo>());
}
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<IntroInfo>());
}
@@ -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<IntroInfo>());
}
var intros = new List<IntroInfo>();
@@ -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<IEnumerable<IntroInfo>>(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,

View File

@@ -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