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

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