fix: apply hide spoilers setting to hero section

close #588
This commit is contained in:
edde746
2026-02-28 06:18:11 +01:00
parent 078f6b29d5
commit 48c9dcae1b
2 changed files with 24 additions and 3 deletions
+4 -2
View File
@@ -102,11 +102,13 @@ extension PlexMetadataType on PlexMetadata {
bool get isVideoContent => ContentTypes.videoTypes.contains(_lowerType);
/// Whether this episode should have spoiler protection applied.
/// True when the item is an unwatched episode with no active progress.
/// True when the item is an unwatched episode watched less than 50%.
bool get shouldHideSpoiler {
if (!isEpisode) return false;
if (isWatched) return false;
if (viewOffset != null && viewOffset! > 0) return false;
if (viewOffset != null && viewOffset! > 0 && duration != null && duration! > 0) {
return viewOffset! / duration! < 0.5;
}
return true;
}
}