feat: add genre, rating, and avoid-repeats trailer filters
All checks were successful
Publish Release / release (push) Successful in 23s

Trailer selection now supports three optional filters:
- Genre match: prefer trailers whose fake-movie genre overlaps with the
  feature being played (requires TMDB genres in NFO)
- Age rating ceiling: exclude trailers rated higher than the feature
  (requires TMDB certification in NFO)
- Avoid repeats: cycle through all trailers before replaying any;
  resets per-user once the pool is exhausted

Genre and certification are fetched from TMDB at download time via a
single /movie/{id}?append_to_response=release_dates call and written
into the fake-movie NFO as <genre> and <mpaa> tags. All filters fall
back to the full unfiltered pool when no match is found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin
2026-06-09 17:15:11 -04:00
parent 6772bde3b4
commit 83966f40ea
8 changed files with 231 additions and 24 deletions

View File

@@ -43,5 +43,14 @@ namespace Jellyfin.Plugin.CinemaTrailers4Jellyfins.Configuration
/// <summary>Number of trailers to inject before each movie via IIntroProvider. 0 = disabled.</summary>
public int TrailersPerMovie { get; set; } = 1;
/// <summary>Only pick trailers whose genre overlaps with the movie being played.</summary>
public bool FilterByGenre { get; set; } = false;
/// <summary>Only pick trailers rated at most the same as the movie being played.</summary>
public bool FilterByRating { get; set; } = false;
/// <summary>Cycle through all trailers before repeating any.</summary>
public bool AvoidRepeats { get; set; } = true;
}
}